Skip to content

Commit 37951f2

Browse files
authored
Merge pull request #4255 from palnabarun/fix-k8s-cloud-builder
Reintroduce docker-buildx plugin to k8s-cloud-builder image
2 parents ee1a65f + d2d6a09 commit 37951f2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

images/k8s-cloud-builder/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
9696
docker-ce-cli=5:24.0.* \
9797
&& apt-mark hold docker-ce-cli
9898

99+
# Install docker-buildx plugin manually to avoid apt pulling in newer API versions
100+
# Buildx v0.14.1 supports Docker API 1.41+ (Docker Engine 20.10+)
101+
# See: https://github.com/docker/buildx/releases
102+
ARG BUILDX_VERSION=0.14.1
103+
RUN mkdir -p /usr/lib/docker/cli-plugins \
104+
&& curl -fsSL "https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64" \
105+
-o /usr/lib/docker/cli-plugins/docker-buildx \
106+
&& chmod +x /usr/lib/docker/cli-plugins/docker-buildx
107+
99108
# Cleanup a bit
100109
RUN apt-get -qqy remove \
101110
wget \

images/k8s-cloud-builder/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ commandTests:
3232
- -c
3333
- |
3434
pip list | grep '^crcmod\b'
35+
- name: docker buildx is installed
36+
command: docker
37+
args: [ "buildx", "version" ]
38+
expectedOutput: [ "github.com/docker/buildx" ]
3539

3640
- name: commands are available
3741
command: /test.sh

0 commit comments

Comments
 (0)