2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-10 13:10:26 +00:00
cointop/Dockerfile

47 lines
1.4 KiB
Docker
Raw Normal View History

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" \
"https://github.com/miguelmota/cointop/archive/$VERSION.tar.gz" \
&& wget \
--output-document "/cointop-colors-master.tar.gz" \
"https://github.com/cointop-sh/colors/archive/master.tar.gz" \
&& mkdir --parents \
"$GOPATH/src/github.com/miguelmota/cointop" \
"/usr/local/share/cointop/colors" \
&& tar \
--directory "$GOPATH/src/github.com/miguelmota/cointop" \
--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 \
&& cd "$GOPATH/src/github.com/miguelmota/cointop" \
&& CGO_ENABLED=0 go install -ldflags "-s -w -X 'github.com/miguelmota/cointop/cointop.version=$VERSION'" \
&& 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"]