dockron/Dockerfile

21 lines
445 B
Docker
Raw Normal View History

2019-06-07 22:40:04 +00:00
ARG REPO=library
FROM golang:1.11-alpine AS builder
2018-08-03 18:35:49 +00:00
2019-06-07 22:40:04 +00:00
RUN apk add --no-cache git
2018-08-03 18:35:49 +00:00
RUN go get -u github.com/golang/dep/cmd/dep
WORKDIR /go/src/app/
COPY ./Gopkg.* /go/src/app/
RUN dep ensure --vendor-only
COPY ./main.go /go/src/app/
2019-06-07 22:40:04 +00:00
ARG ARCH=amd64
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -installsuffix nocgo -o dockron .
FROM ${REPO}/busybox:latest
2018-08-03 18:35:49 +00:00
WORKDIR /root/
2018-08-04 02:22:54 +00:00
COPY --from=builder /go/src/app/dockron .
2018-08-03 18:35:49 +00:00
2018-08-04 02:22:54 +00:00
CMD [ "./dockron" ]