Skip to content

Conversation

@rejeangroleau
Copy link
Contributor

@rejeangroleau rejeangroleau commented Jul 14, 2025

On ubuntu bionic and some other debian/versions, the docker-model-plugin package is missing. The suggestion was to just install the package named docker-buildx-plugin in the version 23 check, while moving the missing package docker-model-plugin to a new "version 28.2" check.

See: #509

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left some comments

install.sh Outdated
fi
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
case "$lsb_dist.$dist_version" in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be inside the RPM-based block, it needs to go in:

docker-install/install.sh

Lines 549 to 558 in 7040dd2

if version_gte "18.09"; then
# older versions didn't ship the cli and containerd as separate packages
pkgs="$pkgs docker-ce-cli${cli_pkg_version%=} containerd.io"
fi
if version_gte "20.10"; then
pkgs="$pkgs docker-compose-plugin docker-ce-rootless-extras$pkg_version"
fi
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvoland I just move it (from line 600-something to line 557). But I can also use your "version 28" approach if you want me to.

install.sh Outdated
Comment on lines 658 to 659
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
case "$lsb_dist.$dist_version" in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I think we can make our life easier and only consider model plugin from 28.0+ up. (buildx still 23.0)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvoland I agree, ok, so would you like me to just replace the "new" switch case by just an additional if version_gte "28.0" that contains just the model plugin (while keeping just the buildx plugin in the "if 23" section)? I could do that. Not sure if v28 is availble for me to test right now though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct!

For testing purposes, you can use whatever version_gte X you want, just make sure to change it before pushing :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvoland Ok I did just that, and I used @thaJeztah suggestion of version 27 (but if you would rather use version 28 I can do that too).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. This is a best-effort check anyway 👍🏻

install.sh Outdated
fi
if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
case "$lsb_dist.$dist_version" in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we should avoid having to maintain this list of distros. We definitely don't want to end up having adding each new distro to the list.
We should default to installing all plugins (after a version check), and then only disable for the distros we know that are not supported.

@thaJeztah
Copy link
Member

I'm a bit on the fence on this; we're adding complexity for EOL distros that the script no longer maintains; perhaps instead we need to make the deprecation warning a hard failure instead;

curl -fsSL https://get.docker.com | DRY_RUN=1 sh
# Executing docker install script, commit: 7040dd2bf115a359317b1de84de611aeabcb7bc2

DEPRECATION WARNING
    This Linux distribution (ubuntu bionic) reached end-of-life and is no longer supported by this script.
    No updates or security fixes will be released for this distribution, and users are recommended
    to upgrade to a currently maintained version of ubuntu.

Press Ctrl+C now to abort this script, or wait for the installation to continue.
^C

Alternatively, we could make the model plugin conditional on version, and only install on current version(s) (e.g., 27.x and up), although strictly speaking, the plugin doesn't depend on those versions, and could be installed on older versions;

docker-install/install.sh

Lines 658 to 660 in 7040dd2

if version_gte "23.0"; then
pkgs="$pkgs docker-buildx-plugin docker-model-plugin"
fi

@rejeangroleau rejeangroleau force-pushed the bugfix/avoid-installing-missing-packages branch 2 times, most recently from 3214c19 to e856a4f Compare July 14, 2025 19:11
@rejeangroleau rejeangroleau changed the title Avoid installing missing packages for version 23 Avoid installing missing packages for version 23 (and moving them to 27.x) Jul 14, 2025
@vvoland
Copy link
Contributor

vvoland commented Jul 14, 2025

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after DCO

@rejeangroleau rejeangroleau force-pushed the bugfix/avoid-installing-missing-packages branch from e856a4f to 2b7768e Compare July 14, 2025 19:26
@rejeangroleau
Copy link
Contributor Author

rejeangroleau commented Jul 15, 2025

I found an easy way to test if this works using docker containers (instead of EC2 machines or other VM types):
command (running inside the folder where the docker-install repo was cloned):

docker run -v $(pwd):/docker-install ubuntu:18.04 /docker-install/install.sh

output:

# Executing docker install script, commit: 

DEPRECATION WARNING
    This Linux distribution (ubuntu bionic) reached end-of-life and is no longer supported by this script.
    No updates or security fixes will be released for this distribution, and users are recommended
    to upgrade to a currently maintained version of ubuntu.

Press Ctrl+C now to abort this script, or wait for the installation to continue.
+ sh -c apt-get -qq update >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get -y -qq install ca-certificates curl >/dev/null
debconf: delaying package configuration, since apt-utils is not installed
+ sh -c install -m 0755 -d /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" -o /etc/apt/keyrings/docker.asc
+ sh -c chmod a+r /etc/apt/keyrings/docker.asc
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get -qq update >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get -y -qq install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin docker-model-plugin >/dev/null
E: Unable to locate package docker-model-plugin

So yeah without a --version, the script still fails (so older CI/CD pipelines will still have to be adjusted to add a --version statement).

But with the command:

docker run -v $(pwd):/docker-install ubuntu:18.04 /docker-install/install.sh --version 23.0

output:

# Executing docker install script, commit: 

DEPRECATION WARNING
    This Linux distribution (ubuntu bionic) reached end-of-life and is no longer supported by this script.
    No updates or security fixes will be released for this distribution, and users are recommended
    to upgrade to a currently maintained version of ubuntu.

Press Ctrl+C now to abort this script, or wait for the installation to continue.
+ sh -c apt-get -qq update >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get -y -qq install ca-certificates curl >/dev/null
debconf: delaying package configuration, since apt-utils is not installed
+ sh -c install -m 0755 -d /etc/apt/keyrings
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" -o /etc/apt/keyrings/docker.asc
+ sh -c chmod a+r /etc/apt/keyrings/docker.asc
+ sh -c echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu bionic stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get -qq update >/dev/null
INFO: Searching repository for VERSION '23.0'
INFO: apt-cache madison docker-ce | grep '23.0' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
INFO: apt-cache madison docker-ce-cli | grep '23.0' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get -y -qq install docker-ce=5:23.0.6-1~ubuntu.18.04~bionic docker-ce-cli=5:23.0.6-1~ubuntu.18.04~bionic containerd.io docker-compose-plugin docker-ce-rootless-extras=5:23.0.6-1~ubuntu.18.04~bionic docker-buildx-plugin >/dev/null
debconf: delaying package configuration, since apt-utils is not installed

================================================================================

To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:

    dockerd-rootless-setuptool.sh install

Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.


To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/

WARNING: Access to the remote API on a privileged Docker daemon is equivalent
         to root access on the host. Refer to the 'Docker daemon attack surface'
         documentation for details: https://docs.docker.com/go/attack-surface/

================================================================================

Now this works fine. So it looks like this PR modification has the intended effect to only install docker-buildx-plugin (not docker-model-plugin anymore) when specifying --version 23.0 with success.

I also tested with --version 27.0 but obviously that is not yet available of course:

INFO: Searching repository for VERSION '27.0'
INFO: apt-cache madison docker-ce | grep '27.0' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3

ERROR: '27.0' not found amongst apt-cache madison results

I will test the other distros too later today (using the same docker commands). Just brainstorming here: could we put that test in an automated github CI/CD pipeline? Maybe that would be too costly.

@rejeangroleau
Copy link
Contributor Author

So I tested with: docker run -v $(pwd):/docker-install quay.io/centos/centos:stream9 /docker-install/install.sh and it works just fine (already did before this PR: docker-model-plugin is available for this distro version).

Then I tested with ubuntu:22.04 and it also works great.

Then I tested with ubuntu:24.04 and it also works great.

Lastly, I thought I would test ubuntu:20.04 and I realised: there is a small problem that we could address.

This distro version 20.04 supports docker version 27, even version 28, but does not contain the docker-model-plugin associated with it. It looks like the docker-model-plugin was released with version 28.2 (and ubuntu:20.04 stopped having new docker versions at 28.1).

So maybe I could change the if condition to version_gte 28.2 to support ubuntu:20.04 too, what do you think @vvoland? Would that be overkill?

@vvoland
Copy link
Contributor

vvoland commented Jul 16, 2025

It's fine IMO. It's only a default anyway, and user can always do explicit installation of the model plugin.

@thaJeztah
Copy link
Member

Yes, changing to version_gte 28.2 sounds good to me. I originally added it to version_gte 23.0 with the idea that any of those versions would be recent enough to support plugins, but did not account for some distros on those versions to not have the plugin package available. This was mostly to "opportunistically" install docker model because some people asked "can I have docker model on my machine?".

I guess it's fine to just do it by default on v28.2 (or "latest") as installing "latest version" would be the most common case for users to install using this script

On ubuntu bionic and focal (and debian buster too), the docker-model-plugin
package is missing. The suggestion was to just install the package named
docker-buildx-plugin in the version 23 check, while moving the missing
package docker-model-plugin to a new version 28.2 check. The number was
chosen because that package becomes available starting with version 28.2
on ubuntu jammy (while not available in version 28.1 on ubuntu focal).

See: docker#509

Signed-off-by: Rejean Groleau <rejeangroleau@gmail.com>
@rejeangroleau rejeangroleau force-pushed the bugfix/avoid-installing-missing-packages branch from 2b7768e to 4ff191b Compare July 16, 2025 12:22
@rejeangroleau rejeangroleau changed the title Avoid installing missing packages for version 23 (and moving them to 27.x) Avoid installing missing packages for version 23 (and moving them to 28.2) Jul 16, 2025
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thaJeztah
Copy link
Member

@vvoland PTAL

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@vvoland vvoland merged commit 1cca0b3 into docker:master Jul 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants