Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
Fixes komkom#4
  • Loading branch information
wwuck committed May 18, 2021
1 parent 96fdd02 commit 40caacd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.16-alpine AS build

# get the latest security updates
# https://github.com/hadolint/hadolint/issues/562
RUN apk --no-cache upgrade

WORKDIR /go/src/app
COPY . .

# build a static binary for running from scratch
# https://github.com/jeremyhuiskamp/golang-docker-scratch
RUN go get -d -v ./...; \
CGO_ENABLED=0 go install -ldflags '-extldflags "-static"' -tags timetzdata -v ./...

FROM scratch
COPY --from=build /go/bin/cmd /app

CMD ["/app"]

0 comments on commit 40caacd

Please sign in to comment.