Skip to content

Instantly share code, notes, and snippets.

@giautm
Created October 26, 2018 14:07
Show Gist options
  • Save giautm/5af88783e55d7bb14fbce4fc96a014bc to your computer and use it in GitHub Desktop.
Save giautm/5af88783e55d7bb14fbce4fc96a014bc to your computer and use it in GitHub Desktop.
Dockerfile for Golang, using at TiKi@Ops
FROM golang:1.11.1-stretch as builder
WORKDIR /ops-golang
COPY . ./
RUN CGO_ENABLED=0 \
GOOS=linux \
go build -mod=vendor -o app
FROM alpine:3.8
WORKDIR /root/
RUN apk add \
ca-certificates
COPY --from=builder /ops-golang/app .
CMD ["./app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment