dockron/Dockerfile.multi-stage

17 lines
345 B
Docker
Raw Normal View History

2019-06-08 00:08:15 +00:00
ARG REPO=library
FROM ${REPO}/golang:1.11-alpine AS builder
COPY ./go.mod ./go.sum /go/src/app/
RUN go mod download
COPY ./main.go /go/src/app/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix nocgo -o dockron .
FROM ${REPO}/busybox:latest
WORKDIR /root/
COPY --from=builder /go/src/app/dockron .
CMD [ "./dockron" ]