install docker-buildx-plugin on >= 22.06 (test channel only currently)#295
Conversation
3a96765 to
e1b3592
Compare
| pkgs="$pkgs docker-scan-plugin" | ||
| fi | ||
| # TODO(thaJeztah) remove the $CHANNEL check once 22.06 and docker-buildx-plugin is published to the "stable" channel | ||
| if [ "$CHANNEL" = "test" ] && version_gte "22.06"; then |
There was a problem hiding this comment.
Version wouldn't ever be greater than 22.06 in the stable channel yet anyhow, right? So this is probably safe to remove the CHANNEL test from and merge? 🙏
There was a problem hiding this comment.
So.. lol, it was late when I originally wrote this patch, and I wasn't sure what version_gte did if no version was specified explicitly (as "no version" means "install latest"), so I wanted to safeguard against that (Then decided not to take the risk either way, and leave it in draft until later)
I should have a look at that, and if that's not the case, I can remove it.
There was a problem hiding this comment.
Did a quick try to see what happens if we remove the $CHANNEL check, but it's indeed written with the assumption that "if no version is specified, then version_gte is always true";
curl -fsSL https://raw.githubusercontent.com/thaJeztah/docker-install/add_buildx_package/install.sh -o get-docker.sh
sed -i 's/\[ "$CHANNEL" = "test" ] && //g' ./get-docker.sh sh ./get-docker.sh
# Executing docker install script, commit:
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-scan-plugin docker-buildx-plugin >/dev/null
E: Unable to locate package docker-buildx-pluginWe could change that to have the script actually resolve the latest version, so get it from, e.g.;
apt-cache policy 'docker-ce' | grep 'Candidate:' | cut -d' ' -f4
5:20.10.17~3-0~ubuntu-jammyBut I guess that would make the script a bit too complicated, just for this purpose.
The buildx plugin has moved to a separate package for the 22.06 release. We're currently doing test-builds on staging, so only try to install this when using both the "test" channel and the staging domain. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
e1b3592 to
df6b692
Compare
|
As Some details can be found in https://askubuntu.com/a/602
However, explicitly installing all packages (as we describe in our install docs, and as this script does) will avoid that situation. Giving this a try (using the updated First, install docker 20.10.17 curl -fsSL https://raw.githubusercontent.com/thaJeztah/docker-install/add_buildx_package/install.sh | CHANNEL=test VERSION=20.10.17 sh
docker version
Client: Docker Engine - Community
Version: 20.10.17
...
Server: Docker Engine - Community
Engine:
Version: 20.10.17
...Check the buildx version ( docker buildx version
github.com/docker/buildx v0.8.2-docker 6224def4dd2c3d347eee19db595348c50d7cb491And the list of packages installed dpkg -l | grep docker
ii docker-ce 5:20.10.17~3-0~ubuntu-jammy amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:20.10.17~3-0~ubuntu-jammy amd64 Docker CLI: the open-source application container engine
ii docker-ce-rootless-extras 5:20.10.17~3-0~ubuntu-jammy amd64 Rootless support for Docker.
ii docker-compose-plugin 2.6.0~ubuntu-jammy amd64 Docker Compose (V2) plugin for the Docker CLI.
ii docker-scan-plugin 0.17.0~ubuntu-jammy amd64 Docker scan cli plugin.Then, upgrade to 22.06 (removing curl -fsSL https://raw.githubusercontent.com/thaJeztah/docker-install/add_buildx_package/install.sh | CHANNEL=test sh
docker version
Client: Docker Engine - Community
Version: 22.06.0-beta.0
...
Server: Docker Engine - Community
Engine:
Version: 22.06.0-beta.0
...Check the buildx version ( docker buildx version
github.com/docker/buildx v0.8.2And the list of packages installed dpkg -l | grep docker
ii docker-buildx-plugin 0.8.2~ubuntu-jammy amd64 Docker Buildx cli plugin.
ii docker-ce 5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy amd64 Docker: the open-source application container engine
ii docker-ce-cli 5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy amd64 Docker CLI: the open-source application container engine
ii docker-ce-rootless-extras 5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy amd64 Rootless support for Docker.
ii docker-compose-plugin 2.6.0~ubuntu-jammy amd64 Docker Compose (V2) plugin for the Docker CLI.
ii docker-scan-plugin 0.17.0~ubuntu-jammy amd64 Docker scan cli plugin. |
|
Did a quick check if version matching still works after we changed the version format for the packages in docker/docker-ce-packaging#701. Tried to see if specifying curl -fsSL https://raw.githubusercontent.com/thaJeztah/docker-install/add_buildx_package/install.sh | CHANNEL=test VERSION=22.06.0-beta.0 sh
# Executing docker install script, commit:
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy test" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
INFO: Searching repository for VERSION '22.06.0-beta.0'
INFO: apt-cache madison 'docker-ce' | grep '22.06.0.*beta.0.*-0~ubuntu' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
INFO: apt-cache madison 'docker-ce-cli' | grep '22.06.0.*beta.0.*-0~ubuntu' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy docker-ce-cli=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy containerd.io docker-compose-plugin docker-scan-plugin docker-buildx-plugin >/dev/null
+ version_gte 20.10
+ [ -z 22.06.0-beta.0 ]
+ eval calver_compare 22.06.0-beta.0 20.10
+ calver_compare 22.06.0-beta.0 20.10
+ set +x
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy >/dev/null
+ sh -c docker version
Client: Docker Engine - Community
Version: 22.06.0-beta.0Also tried specifying a partial version ( curl -fsSL https://raw.githubusercontent.com/thaJeztah/docker-install/add_buildx_package/install.sh | CHANNEL=test VERSION=22.06 sh
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
+ sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy test" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
INFO: Searching repository for VERSION '22.06'
INFO: apt-cache madison 'docker-ce' | grep '22.06.*-0~ubuntu' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
INFO: apt-cache madison 'docker-ce-cli' | grep '22.06.*-0~ubuntu' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends docker-ce=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy docker-ce-cli=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy containerd.io docker-compose-plugin docker-scan-plugin docker-buildx-plugin >/dev/null
+ version_gte 20.10
+ [ -z 22.06 ]
+ eval calver_compare 22.06 20.10
+ calver_compare 22.06 20.10
+ set +x
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce-rootless-extras=5:22.06.0~beta.0-0~ubuntu.22.04.0~jammy >/dev/null
+ sh -c docker version
Client: Docker Engine - Community
Version: 22.06.0-beta.0 |
|
Alright; based on the testing above, this looks to be working as expected; let me bring this one in. |
|
Scripts at https://get.docker.com and https://test.docker.com have been updated; curl -fsSL https://get.docker.com | sudo CHANNEL=test shor the curl -fsSL https://test.docker.com | sudo sh |
The buildx plugin has moved to a separate package for the 22.06 release.
We're currently doing test-builds on staging, so only try to install
this when using both the "test" channel and the staging domain.