Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions vermeer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
FROM golang:1.23-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder
RUN apk add --no-cache npm bash curl
COPY ./ /src/
WORKDIR /src/
ENV CGO_ENABLED="0"

COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download

COPY scripts/download_ui_assets.sh ./scripts/
COPY ui/package.json ./ui/
RUN ./scripts/download_ui_assets.sh
RUN cd asset && go generate
RUN go build -o /go/bin/app

COPY ./ ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
cd asset && go generate
ARG TARGETOS
ARG TARGETARCH
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /go/bin/app

FROM alpine
EXPOSE 8080
Expand Down
Loading