From 80ea78a3c5526eb70867c0d9cc8dddd2acf25c24 Mon Sep 17 00:00:00 2001 From: Jeremy Alvis Date: Wed, 1 Mar 2023 14:06:37 -0700 Subject: [PATCH] Add docker buildx setup to release.jenkinsfile (#42) --- release.Jenkinsfile | 2 ++ scripts/install_docker_buildx.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 scripts/install_docker_buildx.sh diff --git a/release.Jenkinsfile b/release.Jenkinsfile index 737f012..6b7cbb4 100644 --- a/release.Jenkinsfile +++ b/release.Jenkinsfile @@ -31,6 +31,7 @@ pipeline { } steps { sh 'echo $HARBOR_CREDS_PSW | docker login $DOCKER_REPO -u $HARBOR_CREDS_USR --password-stdin' + sh './scripts/install_docker_buildx.sh' sh 'make publish' } } @@ -44,6 +45,7 @@ pipeline { steps { sh 'echo $DOCKERHUB_CREDS_PSW | docker login -u $DOCKERHUB_CREDS_USR --password-stdin' + sh './scripts/install_docker_buildx.sh' sh 'make publish' } } diff --git a/scripts/install_docker_buildx.sh b/scripts/install_docker_buildx.sh new file mode 100755 index 0000000..5c6dc31 --- /dev/null +++ b/scripts/install_docker_buildx.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e +if [[ ! -f "$HOME/.docker/cli-plugins/docker-buildx" ]]; then + echo "installing docker buildx..." + wget -q -O docker-buildx https://github.com/docker/buildx/releases/download/v0.9.1/buildx-v0.9.1.linux-amd64 + chmod a+x docker-buildx + [[ ! -d "$HOME/.docker/cli-plugins" ]] && mkdir -p ~/.docker/cli-plugins + mv docker-buildx ~/.docker/cli-plugins + echo "successfully installed docker buildx: $(docker buildx version)" +else + echo "buildx already installed: $(docker buildx version)" +fi