Update entrypoint and update multi-stage builds
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
IamTheFij 2019-08-14 10:59:51 -07:00
parent a6b46bfca2
commit c89d1e314c
2 changed files with 5 additions and 4 deletions

View File

@ -5,4 +5,4 @@ WORKDIR /root/
ARG ARCH=amd64 ARG ARCH=amd64
COPY ./dockron-linux-${ARCH} ./dockron COPY ./dockron-linux-${ARCH} ./dockron
CMD [ "./dockron" ] ENTRYPOINT [ "./dockron" ]

View File

@ -1,5 +1,5 @@
ARG REPO=library ARG REPO=library
FROM ${REPO}/golang:1.12-alpine AS builder FROM golang:1.12-alpine AS builder
RUN apk add --no-cache git RUN apk add --no-cache git
@ -10,13 +10,14 @@ COPY ./go.mod ./go.sum /app/
RUN go mod download RUN go mod download
COPY ./main.go /app/ COPY ./main.go /app/
ARG ARCH=amd64 ARG ARCH=amd64
ARG VERSION=dev ARG VERSION=dev
ENV CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} ENV CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH}
RUN go build -ldflags '-X "main.version=${VERSION}"' -a -installsuffix nocgo -o dockron . RUN go build -ldflags "-X main.version=${VERSION}" -a -installsuffix nocgo -o dockron .
FROM ${REPO}/busybox:latest FROM ${REPO}/busybox:latest
WORKDIR /root/ WORKDIR /root/
COPY --from=builder /app/dockron . COPY --from=builder /app/dockron .
CMD [ "./dockron" ] ENTRYPOINT [ "./dockron" ]