Skip to content

Commit f739672

Browse files
committed
Include CLI tool in Docker image
1 parent e355152 commit f739672

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ FROM docker.io/library/golang:alpine as builder
22

33
ARG PB_BUILD_VERSION
44

5+
ARG CLI_VERSION=0.0.6
6+
ARG CLI_PLATFORM=linux_amd64
7+
58
WORKDIR /build
69

710
COPY . .
811

912
RUN set -ex \
10-
&& apk add --no-cache build-base \
13+
&& apk add --no-cache build-base ca-certificates curl \
1114
&& go mod download \
1215
&& go mod verify \
1316
&& PB_BUILD_VERSION="$PB_BUILD_VERSION" make build \
14-
&& chmod +x /build/out/pushbits
17+
&& chmod +x /build/out/pushbits \
18+
&& curl -q -s -S -L -o /tmp/pbcli_${CLI_VERSION}.tar.gz https://github.com/pushbits/cli/releases/download/v${CLI_VERSION}/pbcli_${CLI_VERSION}_${CLI_PLATFORM}.tar.gz \
19+
&& tar -C /usr/local/bin -xvf /tmp/pbcli_${CLI_VERSION}.tar.gz pbcli \
20+
&& chown root:root /usr/local/bin/pbcli \
21+
&& chmod +x /usr/local/bin/pbcli
1522

1623
FROM docker.io/library/alpine
1724

@@ -25,6 +32,7 @@ WORKDIR /app
2532

2633
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2734
COPY --from=builder /build/out/pushbits ./run
35+
COPY --from=builder /usr/local/bin/pbcli /usr/local/bin/pbcli
2836

2937
RUN set -ex \
3038
&& apk add --no-cache ca-certificates curl \

0 commit comments

Comments
 (0)