Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10 backport] fix plugin package versioning for compose #825

Merged
merged 7 commits into from
Jan 18, 2023

Conversation

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e49e4d7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
For easier comparing :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0f8737c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
We'll be using VERSION_ID in other places, so adding it in the Dockerfile makes
sure it's always present, without having to depend on /etc/os-release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e1551c7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
We already had code for this in the RPM packages, but were missing this
in the deb variants. Because of this, pre-release packages used a hyphen
(-) as separator for pre-releases, which get sorted as a "higher" version
than a non-pre-release:

    dpkg --compare-versions "0.10.0" ">>" "0.10.0-rc2" && echo "OK" || echo "KO"
    KO

With this patch, the packages have a correctly formatted version, using
a tilde (~) as separator for the pre-release suffix:

    make DOCKER_CLI_REF=f163d2441e214176db89c63ffc557012113e28d8 DOCKER_ENGINE_REF=9fd3a437a6027637301b0952f7578644d7dff321 VERSION=23.0.0-rc.2 ubuntu-jammy

    tree deb/debbuild/
    deb/debbuild/
    └── ubuntu-jammy
        ├── docker-buildx-plugin_0.10.0~rc2~ubuntu-jammy_arm64.deb
        ├── docker-ce-cli_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        ├── docker-ce-rootless-extras_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.dsc
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy.tar.gz
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.buildinfo
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.changes
        ├── docker-ce_23.0.0~rc.2-0~ubuntu.22.04.0~jammy_arm64.deb
        └── docker-compose-plugin_2.15.1~ubuntu-jammy_arm64.deb

Using a tilde makes sure that pre-releases are sorted correctly:

    dpkg --compare-versions "0.10.0" ">>" "0.10.0~rc2" && echo "OK" || echo "KO"
    OK

The version reported through `docker buildx version` still uses the version
as tagged in the repository (using a hyphen (-));

    make IMAGE=ubuntu:jammy verify

    + verify_binaries
    ...
    + docker buildx version
    github.com/docker/buildx v0.10.0-rc2 64e4c19
    ...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e8d994c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This variable can be used as packaging-revision in package versions

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3e7b469)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Aligning the plugin's version with the format used for docker-ce and
docker-ce-cli, as updated in 39772a7

Before this patch:

    deb/debbuild/
    └── ubuntu-jammy
        ├── docker-buildx-plugin_0.10.0-1~ubuntu.22.04-jammy_arm64.deb
        ├── docker-ce-cli_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        ├── docker-ce-rootless-extras_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        ├── docker-ce_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        └── docker-compose-plugin_2.15.1~ubuntu-jammy_arm64.deb

With this patch:

    deb/debbuild/
    └── ubuntu-jammy
        ├── docker-buildx-plugin_0.10.0-1~ubuntu.22.04-jammy_arm64.deb
        ├── docker-ce-cli_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        ├── docker-ce-rootless-extras_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        ├── docker-ce_23.0.0~rc.2-1~ubuntu.22.04~jammy_arm64.deb
        └── docker-compose-plugin_2.15.1-1~ubuntu.22.04-jammy_arm64.deb

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cdca6d2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
deb/common/rules Outdated Show resolved Hide resolved

# Use separate version for the scan-plugin package, then generate the other control files as usual
# TODO override "Source" field in control as well (to point to scan-cli-plugin, as it doesn't match the package name)
# TODO change once we support scan-plugin on other architectures (see dpkg-architecture -L)
if [ "$(TARGET_ARCH)" = "amd64" ]; then \
dh_gencontrol -pdocker-scan-plugin -- -v$${SCAN_VERSION#v}~$${DISTRO}-$${SUITE}; \
dh_gencontrol -pdocker-scan-plugin -- -v$${SCAN_DEB_VERSION#v}~$${DISTRO}-$${SUITE}; \
Copy link
Contributor

@tianon tianon Jan 11, 2023

Choose a reason for hiding this comment

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

Suggested change
dh_gencontrol -pdocker-scan-plugin -- -v$${SCAN_DEB_VERSION#v}~$${DISTRO}-$${SUITE}; \
dh_gencontrol -pdocker-scan-plugin -- -v$${SCAN_DEB_VERSION#v}-$${PKG_REVISION}~$${DISTRO}.$${VERSION_ID}~$${SUITE}; \

Copy link
Member Author

Choose a reason for hiding this comment

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

The scan changes will be handled in #826

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9e92e21)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review January 18, 2023 20:39
@thaJeztah
Copy link
Member Author

Let me bring this one in so that the next build of the compose plugin has the new version format 👍

@thaJeztah thaJeztah merged commit 5f73ca9 into docker:20.10 Jan 18, 2023
@thaJeztah thaJeztah deleted the 20.10_backport_compose_versioning branch January 18, 2023 20:40
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.

2 participants