Skip to content

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

Merged
thaJeztah merged 7 commits into
docker:20.10from
thaJeztah:20.10_backport_compose_versioning
Jan 18, 2023
Merged

[20.10 backport] fix plugin package versioning for compose#825
thaJeztah merged 7 commits into
docker:20.10from
thaJeztah:20.10_backport_compose_versioning

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>
Comment thread deb/common/rules Outdated
Comment thread deb/common/rules
# 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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