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" ]