Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 88fcef1

Browse files
committed
Download Docker CLI instead of building it
Download the macOS and Linux Docker CLI from download.docker.com instead of building them. Signed-off-by: Christopher Crone <[email protected]>
1 parent 44932b6 commit 88fcef1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4cfce22c523cc12a5a1091cb37705 AS cli-build
2-
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
2+
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
3+
ARG CLI_CHANNEL=stable
4+
ARG CLI_VERSION=19.03.4
35

46
RUN apt-get install -y -q --no-install-recommends \
57
coreutils \
@@ -8,10 +10,13 @@ RUN apt-get install -y -q --no-install-recommends \
810

911
WORKDIR /go/src/github.com/docker/cli
1012

11-
RUN git clone https://github.com/docker/cli . && git checkout a1b83ffd2cbeefc0752e5aa7a543d49c1ddfd2cb
13+
RUN git clone https://github.com/docker/cli . && git checkout v${CLI_VERSION}
14+
RUN mkdir build
15+
RUN curl -fL https://download.docker.com/linux/static/${CLI_CHANNEL}/x86_64/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-linux-amd64 && chmod +x build/docker-linux-amd64
16+
RUN curl -fL https://download.docker.com/mac/static/${CLI_CHANNEL}/x86_64/docker-${CLI_VERSION}.tgz | tar xzO docker/docker > build/docker-darwin-amd64
1217

1318
ARG GOPROXY
14-
RUN make binary-osx binary-windows binary
19+
RUN make binary-windows
1520

1621
# main dev image
1722
FROM golang:1.13.3 AS dev

0 commit comments

Comments
 (0)