We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2dfdaf commit 8c93fd7Copy full SHA for 8c93fd7
1 file changed
Dockerfile
@@ -1,11 +1,16 @@
1
# Build stage
2
FROM golang:1.22-alpine AS builder
3
+# Set necessary environmet variables needed for our image
4
+ENV GO111MODULE=on \
5
+ CGO_ENABLED=0 \
6
+ GOOS=linux
7
WORKDIR /app
-COPY go.mod go.sum ./
8
+COPY go.mod .
9
+COPY go.sum .
10
RUN go mod download
11
COPY . .
12
ARG VERSION=dev
-RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-X main.version=${VERSION}" -o web_proxy_cache .
13
+RUN go build -ldflags "-X main.version=${VERSION}" -o web_proxy_cache .
14
15
# Final image
16
FROM alpine:3.19
0 commit comments