forked from desotech-it/whoami
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (19 loc) · 654 Bytes
/
Dockerfile
File metadata and controls
30 lines (19 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.17-alpine as builder
WORKDIR /whoami
COPY . .
ENV CGO_ENABLED=0
RUN apk update --no-cache && \
apk upgrade --no-cache && \
apk add --no-cache --update ca-certificates make git && \
rm -rf /var/cache/apk* && \
make build
# Create a minimal container to run a Golang static binary
FROM alpine
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /whoami/template/ /whoami/template/
COPY --from=builder /whoami/static/ /whoami/static/
COPY --from=builder /whoami/bin/whoami* /whoami/whoami
WORKDIR /whoami
RUN touch readiness
ENTRYPOINT ["./whoami", "-p", "80"]
EXPOSE 80