Install docker and buildx using official instructions

This commit is contained in:
Andrejs Cunskis 2023-02-14 06:03:11 +09:00
parent 65485241a6
commit 41165c16ff
No known key found for this signature in database
GPG key ID: 87CB75083F227241
4 changed files with 16 additions and 22 deletions

View file

@ -3,10 +3,10 @@
set -xeou pipefail
BUILDX_VERSION=${1}
BUILDX_DOWNLOAD_SHA256=${2}
BUILDX_DOWNLOAD_URL="https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-${TARGETARCH:-amd64}"
/scripts/download-file docker-buildx "$BUILDX_DOWNLOAD_URL" $BUILDX_DOWNLOAD_SHA256
PACKAGE_VERSION=$(apt-cache policy docker-buildx-plugin | awk -v dv=${BUILDX_VERSION} '$1 ~ dv {print $1}')
mkdir -p /usr/local/lib/docker/cli-plugins
chmod +x docker-buildx && mv docker-buildx /usr/local/lib/docker/cli-plugins/
apt-get update && apt-get install -y docker-buildx-plugin=${PACKAGE_VERSION}
apt-get -yq autoremove
apt-get clean -yqq