2021-09-08 05:26:37 +00:00
|
|
|
FROM golang:alpine AS build
|
2020-08-05 16:13:18 +00:00
|
|
|
ARG VERSION
|
2021-09-08 05:26:37 +00:00
|
|
|
RUN wget \
|
|
|
|
--output-document "/cointop-$VERSION.tar.gz" \
|
2021-09-30 06:17:58 +00:00
|
|
|
"https://github.com/cointop-sh/cointop/archive/$VERSION.tar.gz" \
|
2021-09-08 05:26:37 +00:00
|
|
|
&& wget \
|
|
|
|
--output-document "/cointop-colors-master.tar.gz" \
|
|
|
|
"https://github.com/cointop-sh/colors/archive/master.tar.gz" \
|
|
|
|
&& mkdir --parents \
|
2021-09-30 06:17:58 +00:00
|
|
|
"$GOPATH/src/github.com/cointop-sh/cointop" \
|
2021-09-08 05:26:37 +00:00
|
|
|
"/usr/local/share/cointop/colors" \
|
|
|
|
&& tar \
|
2021-09-30 06:17:58 +00:00
|
|
|
--directory "$GOPATH/src/github.com/cointop-sh/cointop" \
|
2021-09-08 05:26:37 +00:00
|
|
|
--extract \
|
|
|
|
--file "/cointop-$VERSION.tar.gz" \
|
|
|
|
--strip-components 1 \
|
|
|
|
&& tar \
|
|
|
|
--directory /usr/local/share/cointop/colors \
|
|
|
|
--extract \
|
|
|
|
--file /cointop-colors-master.tar.gz \
|
|
|
|
--strip-components 1 \
|
|
|
|
&& rm \
|
|
|
|
"/cointop-$VERSION.tar.gz" \
|
|
|
|
/cointop-colors-master.tar.gz \
|
2021-09-30 06:17:58 +00:00
|
|
|
&& cd "$GOPATH/src/github.com/cointop-sh/cointop" \
|
|
|
|
&& CGO_ENABLED=0 go install -ldflags "-s -w -X 'github.com/cointop-sh/cointop/cointop.version=$VERSION'" \
|
2021-09-08 05:26:37 +00:00
|
|
|
&& cd "$GOPATH" \
|
|
|
|
&& rm -r src/github.com \
|
|
|
|
&& apk add --no-cache upx \
|
|
|
|
&& upx --lzma /go/bin/cointop \
|
|
|
|
&& apk del upx
|
2020-05-25 21:32:44 +00:00
|
|
|
|
2021-09-08 05:26:37 +00:00
|
|
|
FROM busybox
|
|
|
|
ARG VERSION
|
|
|
|
ARG MAINTAINER
|
|
|
|
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
|
|
|
COPY --from=build /go/bin/cointop /usr/local/bin/cointop
|
|
|
|
COPY --from=build /usr/local/share /usr/local/share
|
|
|
|
ENV \
|
|
|
|
COINTOP_COLORS_DIR=/usr/local/share/cointop/colors \
|
|
|
|
XDG_CONFIG_HOME=/config
|
|
|
|
EXPOSE 2222
|
|
|
|
LABEL \
|
|
|
|
maintainer="$MAINTAINER" \
|
|
|
|
version="$VERSION"
|
|
|
|
ENTRYPOINT ["cointop"]
|