Skip to content

Instantly share code, notes, and snippets.

@Depado
Created July 3, 2018 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Depado/b172a3bc19be7c016abd650caa622c69 to your computer and use it in GitHub Desktop.
Save Depado/b172a3bc19be7c016abd650caa622c69 to your computer and use it in GitHub Desktop.
# Build step
FROM golang:latest AS build
RUN mkdir -p $GOPATH/src/github.com/Depado/dummy
ADD . $GOPATH/src/github.com/Depado/dummy
WORKDIR $GOPATH/src/github.com/Depado/dummy
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure -vendor-only
RUN CGO_ENABLED=0 go build -o /dummy
# Final step
FROM alpine
RUN apk update
RUN apk upgrade
RUN apk add ca-certificates && update-ca-certificates
RUN apk add --update tzdata
RUN rm -rf /var/cache/apk/*
COPY --from=build /dummy /home/
ENV TZ=Europe/Paris
WORKDIR /home
ENTRYPOINT ./dummy
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment