Skip to content

Instantly share code, notes, and snippets.

@alvaradopcesar
Created June 29, 2019 19:04
Show Gist options
  • Select an option

  • Save alvaradopcesar/a79df33020c7987f9ccd1965493fc5ca to your computer and use it in GitHub Desktop.

Select an option

Save alvaradopcesar/a79df33020c7987f9ccd1965493fc5ca to your computer and use it in GitHub Desktop.
FROM golang:1.11.10-alpine3.9
RUN apk add git gcc g++ libc-dev
WORKDIR /go/src/project-example/
COPY file-example.go .
COPY file-example.yml .
COPY go.mod .
COPY go.sum .
ENV GO111MODULE=on
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o project-example .
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
ENV TZ America/Lima
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY --from=0 /go/src/project-example/file-example .
COPY --from=0 /go/src/project-example/file-example.yml .
EXPOSE 8585
ENTRYPOINT ["/file-example"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment