Update entrypoint and update multi-stage builds
This commit is contained in:
parent
a6b46bfca2
commit
c89d1e314c
@ -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" ]
|
||||||
|
@ -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" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user