From 2d259b95ed9f3b686e1b5f3812e0232e2da8564f Mon Sep 17 00:00:00 2001 From: John Rofrano Date: Fri, 14 Sep 2018 15:07:42 -0400 Subject: [PATCH] fixes #420 (#425) --- transfer-sh/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/transfer-sh/Dockerfile b/transfer-sh/Dockerfile index 6a3416d..0b247e8 100644 --- a/transfer-sh/Dockerfile +++ b/transfer-sh/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine:latest as builder LABEL maintainer "Jess Frazelle " ENV PATH /go/bin:/usr/local/go/bin:$PATH @@ -9,7 +9,8 @@ RUN apk --no-cache add \ ENV TRANSFER_SH_VERSION master -RUN buildDeps=' \ +RUN set -x \ + && apk --no-cache add \ bash \ go \ git \ @@ -18,16 +19,15 @@ RUN buildDeps=' \ libc-dev \ libgcc \ make \ - ' \ - set -x \ - && apk --no-cache add $buildDeps \ && git clone --depth 1 --branch ${TRANSFER_SH_VERSION} https://github.com/dutchcoders/transfer.sh /go/src/github.com/dutchcoders/transfer.sh \ && cd /go/src/github.com/dutchcoders/transfer.sh \ && go build -o /usr/bin/transfer.sh \ - && apk del $buildDeps \ - && rm -rf /go \ && echo "Build complete." +# Create a clean image without build dependencies +FROM alpine:latest + +COPY --from=builder /usr/bin/transfer.sh /usr/bin/transfer.sh ENTRYPOINT [ "transfer.sh" ] CMD [ "--help" ]