Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (12 sloc) 489 Bytes
FROM golang:1.11 as builder
WORKDIR /go/src/github.com/lotharschulz/hellogodocker/
COPY hello.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w -extldflags "-static"' -o hellogodocker .
FROM alpine:latest
RUN apk --no-cache add ca-certificates && \
addgroup -g 99 appuser && \
adduser -D -u 99 -G appuser appuser
USER appuser
WORKDIR /app
COPY --from=builder /go/src/github.com/lotharschulz/hellogodocker/hellogodocker .
CMD ["./hellogodocker"]