We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d31ef20 commit 37509fcCopy full SHA for 37509fc
scratch.dockerfile
@@ -0,0 +1,30 @@
1
+FROM golang as builder
2
+
3
+WORKDIR /go/github.com/coding-latte/golang-docker-multistage-build-demo
4
5
+COPY . .
6
7
+RUN go get .
8
9
+RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
10
11
+# install ca-certificates
12
+#RUN apk --update add ca-certificates
13
14
15
+# deployment image
16
+FROM scratch
17
18
+# RUN apk --no-cache add ca-certificates
19
20
+LABEL author="Maina Wycliffe"
21
22
+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
23
24
+WORKDIR /bin/
25
26
+COPY --from=builder /go/github.com/coding-latte/golang-docker-multistage-build-demo/app .
27
28
+CMD [ "./app" ]
29
30
+EXPOSE 8080
0 commit comments