Skip to content
Open
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
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
FROM golang:1.24.3-alpine3.21 AS builder
ARG GO_VERSION=1.24.3
ARG ALPINE_VERSION=3.21

FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder

WORKDIR /app

RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=bind,source=go.mod,target=go.mod \
--mount=type=bind,source=go.sum,target=go.sum \
go mod download -x && go mod verify

COPY . /app
RUN CGO_ENABLED=0 go build .

FROM alpine:3.21
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache \
CGO_ENABLED=0 go build .

FROM alpine:${ALPINE_VERSION}

WORKDIR /app
COPY --from=builder /app/glance .
Expand Down