Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add curl scratch binary and introduce docker healthcheck #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ RUN make build
# Create a minimal container to run a Golang static binary
FROM scratch

COPY --from=tarampampam/curl /bin/curl /curl
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/whoami/whoami .

HEALTHCHECK --interval=10s --start-period=2s CMD ["/curl", "--fail", "http://127.0.0.1:80/health"]
ENTRYPOINT ["/whoami"]
EXPOSE 80
2 changes: 2 additions & 0 deletions buildx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ RUN apk --no-cache --no-progress add git ca-certificates tzdata make \
# Create a minimal container to run a Golang static binary
FROM scratch

COPY --from=tarampampam/curl /bin/curl /curl
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY whoami /

HEALTHCHECK --interval=10s --start-period=2s CMD ["/curl", "--fail", "http://127.0.0.1:80/health"]
ENTRYPOINT ["/whoami"]
EXPOSE 80