Skip to content

Commit

Permalink
Include CLI tool in Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
eikendev committed Dec 11, 2022
1 parent e355152 commit f739672
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@ FROM docker.io/library/golang:alpine as builder

ARG PB_BUILD_VERSION

ARG CLI_VERSION=0.0.6
ARG CLI_PLATFORM=linux_amd64

WORKDIR /build

COPY . .

RUN set -ex \
&& apk add --no-cache build-base \
&& apk add --no-cache build-base ca-certificates curl \
&& go mod download \
&& go mod verify \
&& PB_BUILD_VERSION="$PB_BUILD_VERSION" make build \
&& chmod +x /build/out/pushbits
&& chmod +x /build/out/pushbits \
&& 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 \
&& tar -C /usr/local/bin -xvf /tmp/pbcli_${CLI_VERSION}.tar.gz pbcli \
&& chown root:root /usr/local/bin/pbcli \
&& chmod +x /usr/local/bin/pbcli

FROM docker.io/library/alpine

Expand All @@ -25,6 +32,7 @@ WORKDIR /app

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

RUN set -ex \
&& apk add --no-cache ca-certificates curl \
Expand Down

0 comments on commit f739672

Please sign in to comment.