Skip to content

Instantly share code, notes, and snippets.

@navono navono/Dockerfile
Last active Sep 7, 2018

What would you like to do?
Dockerfile for golang
FROM golang:1.11 AS builder
# Download and install the latest release of dep
ADD /usr/bin/dep
RUN chmod +x /usr/bin/dep
# Copy the code from the host and compile it
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure --vendor-only
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .
FROM scratch
COPY --from=builder /app ./
ENTRYPOINT ["./app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.