We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 703f9a0 commit c4ea78aCopy full SHA for c4ea78a
1 file changed
Dockerfile
@@ -1,4 +1,4 @@
1
-FROM golang:1.16
+FROM golang:1.16 AS build
2
3
WORKDIR /app
4
COPY go.mod go.sum ./
@@ -9,5 +9,13 @@ COPY . .
9
10
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -a -ldflags "-w -s" -o ./bin/lorem main.go
11
12
+FROM alpine:3.15
13
+
14
+WORKDIR /app
15
16
+COPY --from=build /app/bin/lorem /app/lorem
17
18
+USER 1000:1000
19
20
EXPOSE 8080
-ENTRYPOINT ["./bin/lorem"]
21
+ENTRYPOINT ["./lorem"]
0 commit comments