This commit is contained in:
John Rofrano 2018-09-14 15:07:42 -04:00 committed by Jess Frazelle
parent 2d839cd5ac
commit 2d259b95ed

View File

@ -1,4 +1,4 @@
FROM alpine:latest FROM alpine:latest as builder
LABEL maintainer "Jess Frazelle <jess@linux.com>" LABEL maintainer "Jess Frazelle <jess@linux.com>"
ENV PATH /go/bin:/usr/local/go/bin:$PATH ENV PATH /go/bin:/usr/local/go/bin:$PATH
@ -9,7 +9,8 @@ RUN apk --no-cache add \
ENV TRANSFER_SH_VERSION master ENV TRANSFER_SH_VERSION master
RUN buildDeps=' \ RUN set -x \
&& apk --no-cache add \
bash \ bash \
go \ go \
git \ git \
@ -18,16 +19,15 @@ RUN buildDeps=' \
libc-dev \ libc-dev \
libgcc \ libgcc \
make \ 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 \ && 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 \ && cd /go/src/github.com/dutchcoders/transfer.sh \
&& go build -o /usr/bin/transfer.sh \ && go build -o /usr/bin/transfer.sh \
&& apk del $buildDeps \
&& rm -rf /go \
&& echo "Build complete." && 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" ] ENTRYPOINT [ "transfer.sh" ]
CMD [ "--help" ] CMD [ "--help" ]