diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index ae54daff..cdf3f4a7 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -68,6 +68,8 @@ jobs: PKG_REPO=${{ inputs.engine-repo }} PKG_REF=${{ inputs.engine-ref }} DOCKER_VERSION=${{ inputs.version }} + DOCKER_PLATFORM_NAME=Docker Engine - Community + DOCKER_PRODUCT_LICENSE=Community Engine PKG_DEB_REVISION=${{ inputs.revision }} PKG_RPM_RELEASE=${{ inputs.revision }} dockerhub_username: dockereng @@ -89,6 +91,7 @@ jobs: PKG_REPO=${{ inputs.cli-repo }} PKG_REF=${{ inputs.cli-ref }} DOCKER_VERSION=${{ inputs.version }} + DOCKER_PLATFORM_NAME=Docker Engine - Community PKG_DEB_REVISION=${{ inputs.revision }} PKG_RPM_RELEASE=${{ inputs.revision }} dockerhub_username: dockereng @@ -113,6 +116,8 @@ jobs: CLI_REPO=${{ inputs.cli-repo }} CLI_REF=${{ inputs.cli-ref }} DOCKER_VERSION=${{ inputs.version }} + DOCKER_PLATFORM_NAME=Docker Engine - Community + DOCKER_PRODUCT_LICENSE=Community Engine dockerhub_username: dockereng dockerhub_oidc_connectionid: ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }} diff --git a/docker-bake.hcl b/docker-bake.hcl index bd6e3c48..bb32cd5a 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -196,6 +196,14 @@ variable "DOCKER_VERSION" { description = "Version for Docker, Engine, and CLI packages. If empty, versions are derived from source; combined archives use the Engine version." default = null } +variable "DOCKER_PLATFORM_NAME" { + description = "Platform name embedded in Docker CLI and Engine binaries (shown in `docker version`). Only used for docker, docker-cli, and docker-engine packages." + default = null +} +variable "DOCKER_PRODUCT_LICENSE" { + description = "Default product license embedded in Docker Engine binaries (shown in `docker info`). Only used for docker and docker-engine packages." + default = null +} variable "RUNC_REF" { description = "Reference (branch, tag, commit) of runc to build. Only used for containerd package. If not set, defaults to the version specified in containerd's script/setup/runc-version file." default = null @@ -625,6 +633,8 @@ target "_pkg-docker" { CLI_REPO = CLI_REPO != null && CLI_REPO != "" ? CLI_REPO : "https://github.com/docker/cli.git" CLI_REF = CLI_REF != null && CLI_REF != "" ? CLI_REF : "master" DOCKER_VERSION = DOCKER_VERSION + DOCKER_PLATFORM_NAME = DOCKER_PLATFORM_NAME + DOCKER_PRODUCT_LICENSE = DOCKER_PRODUCT_LICENSE GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.26.8" # https://github.com/moby/moby/blob/master/Dockerfile GO_IMAGE_VARIANT = GO_IMAGE_VARIANT != null && GO_IMAGE_VARIANT != "" ? GO_IMAGE_VARIANT : "bookworm" PKG_REMOTE_DOCKERFILE = "Dockerfile" @@ -637,6 +647,7 @@ target "_pkg-docker-cli" { PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/cli.git" PKG_REF = PKG_REF != null && PKG_REF != "" ? PKG_REF : "master" DOCKER_VERSION = DOCKER_VERSION + DOCKER_PLATFORM_NAME = DOCKER_PLATFORM_NAME GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.26.8" # https://github.com/docker/cli/blob/master/Dockerfile GO_IMAGE_VARIANT = GO_IMAGE_VARIANT != null && GO_IMAGE_VARIANT != "" ? GO_IMAGE_VARIANT : "bookworm" PKG_DEB_EPOCH = PKG_DEB_EPOCH != null && PKG_DEB_EPOCH != "" ? PKG_DEB_EPOCH : "5" @@ -650,6 +661,8 @@ target "_pkg-docker-engine" { PKG_REPO = PKG_REPO != null && PKG_REPO != "" ? PKG_REPO : "https://github.com/docker/docker.git" PKG_REF = PKG_REF != null && PKG_REF != "" ? PKG_REF : "master" DOCKER_VERSION = DOCKER_VERSION + DOCKER_PLATFORM_NAME = DOCKER_PLATFORM_NAME + DOCKER_PRODUCT_LICENSE = DOCKER_PRODUCT_LICENSE GO_VERSION = GO_VERSION != null && GO_VERSION != "" ? GO_VERSION : "1.26.8" # https://github.com/moby/moby/blob/master/Dockerfile GO_IMAGE_VARIANT = GO_IMAGE_VARIANT != null && GO_IMAGE_VARIANT != "" ? GO_IMAGE_VARIANT : "bookworm" PKG_DEB_EPOCH = PKG_DEB_EPOCH != null && PKG_DEB_EPOCH != "" ? PKG_DEB_EPOCH : "5" diff --git a/pkg/docker-cli/Dockerfile b/pkg/docker-cli/Dockerfile index 203b0a41..b53fe438 100644 --- a/pkg/docker-cli/Dockerfile +++ b/pkg/docker-cli/Dockerfile @@ -113,6 +113,7 @@ ARG TARGETPLATFORM RUN mk-build-deps -t "xx-apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/package/debian/control WORKDIR /root/package ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME ARG NIGHTLY_BUILD ARG DISTRO_RELEASE ARG DISTRO_ID @@ -151,6 +152,7 @@ RUN --mount=type=bind,from=scripts,source=rpm-builddep.sh,target=/usr/local/bin/ rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME ARG NIGHTLY_BUILD ARG DISTRO_RELEASE ARG DISTRO_ID diff --git a/pkg/docker-cli/scripts/pkg-deb-build.sh b/pkg/docker-cli/scripts/pkg-deb-build.sh index 23eaaca1..9c48261b 100755 --- a/pkg/docker-cli/scripts/pkg-deb-build.sh +++ b/pkg/docker-cli/scripts/pkg-deb-build.sh @@ -16,6 +16,8 @@ : "${NIGHTLY_BUILD=}" +: "${DOCKER_PLATFORM_NAME=}" + : "${DISTRO_NAME=}" : "${DISTRO_RELEASE=}" : "${DISTRO_ID=}" @@ -70,5 +72,5 @@ mkdir -p "${pkgoutput}" set -x chmod -x debian/control debian/docs debian/*.manpages -VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT_SHORT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) +PLATFORM="${DOCKER_PLATFORM_NAME}" VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT_SHORT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) cp /root/docker-* "${pkgoutput}"/ diff --git a/pkg/docker-cli/scripts/pkg-rpm-build.sh b/pkg/docker-cli/scripts/pkg-rpm-build.sh index 7062e8a1..15769866 100755 --- a/pkg/docker-cli/scripts/pkg-rpm-build.sh +++ b/pkg/docker-cli/scripts/pkg-rpm-build.sh @@ -16,6 +16,8 @@ : "${NIGHTLY_BUILD=}" +: "${DOCKER_PLATFORM_NAME=}" + : "${DISTRO_NAME=}" : "${DISTRO_RELEASE=}" : "${DISTRO_ID=}" @@ -72,7 +74,7 @@ fi set -x -rpmbuild --target $(xx-info rhel-arch) $PKG_RPM_BUILDFLAGS "${rpmDefine[@]}" /root/rpmbuild/SPECS/*.spec +PLATFORM="${DOCKER_PLATFORM_NAME}" rpmbuild --target $(xx-info rhel-arch) $PKG_RPM_BUILDFLAGS "${rpmDefine[@]}" /root/rpmbuild/SPECS/*.spec mkdir -p "${pkgoutput}" cp ./RPMS/*/*.* "${pkgoutput}"/ if [ "$(ls -A ./SRPMS)" ]; then diff --git a/pkg/docker-engine/Dockerfile b/pkg/docker-engine/Dockerfile index cefe547e..e0b7236c 100644 --- a/pkg/docker-engine/Dockerfile +++ b/pkg/docker-engine/Dockerfile @@ -114,6 +114,7 @@ ARG TARGETPLATFORM RUN mk-build-deps -t "xx-apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/package/debian/control WORKDIR /root/package ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME ARG NIGHTLY_BUILD ARG DISTRO_RELEASE ARG DISTRO_ID @@ -163,6 +164,7 @@ RUN --mount=type=bind,from=scripts,source=rpm-builddep.sh,target=/usr/local/bin/ EOT WORKDIR /root/rpmbuild ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME ARG NIGHTLY_BUILD ARG DISTRO_RELEASE ARG DISTRO_ID @@ -201,6 +203,8 @@ RUN --mount=type=bind,from=gocross,source=/usr/local/go,target=/usr/local/go,rw FROM build-base-static AS builder-static RUN apt-get install -y --no-install-recommends clang cmake gcc libc6-dev lld llvm make pkg-config ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME +ARG DOCKER_PRODUCT_LICENSE ARG PKG_NAME ARG PKG_REF ARG NIGHTLY_BUILD diff --git a/pkg/docker-engine/scripts/pkg-deb-build.sh b/pkg/docker-engine/scripts/pkg-deb-build.sh index 4d5c47ce..a595a963 100755 --- a/pkg/docker-engine/scripts/pkg-deb-build.sh +++ b/pkg/docker-engine/scripts/pkg-deb-build.sh @@ -16,6 +16,8 @@ : "${NIGHTLY_BUILD=}" +: "${DOCKER_PLATFORM_NAME=}" + : "${DISTRO_NAME=}" : "${DISTRO_RELEASE=}" : "${DISTRO_ID=}" @@ -72,5 +74,5 @@ mkdir -p "${pkgoutput}" set -x chmod -x debian/control debian/docs debian/docker-ce.dirs debian/docker-ce.maintscript debian/docker-ce.manpages -VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT_SHORT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) +PLATFORM="${DOCKER_PLATFORM_NAME}" VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT_SHORT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) cp /root/docker-* "${pkgoutput}"/ diff --git a/pkg/docker-engine/scripts/pkg-rpm-build.sh b/pkg/docker-engine/scripts/pkg-rpm-build.sh index c05b4805..3a76587d 100755 --- a/pkg/docker-engine/scripts/pkg-rpm-build.sh +++ b/pkg/docker-engine/scripts/pkg-rpm-build.sh @@ -16,6 +16,8 @@ : "${NIGHTLY_BUILD=}" +: "${DOCKER_PLATFORM_NAME=}" + : "${DISTRO_NAME=}" : "${DISTRO_RELEASE=}" : "${DISTRO_ID=}" @@ -95,7 +97,7 @@ fi set -x -rpmbuild --target $(xx-info rhel-arch) $PKG_RPM_BUILDFLAGS "${rpmDefine[@]}" /root/rpmbuild/SPECS/*.spec +PLATFORM="${DOCKER_PLATFORM_NAME}" rpmbuild --target $(xx-info rhel-arch) $PKG_RPM_BUILDFLAGS "${rpmDefine[@]}" /root/rpmbuild/SPECS/*.spec mkdir -p "${pkgoutput}" cp ./RPMS/*/*.* "${pkgoutput}"/ if [ "$(ls -A ./SRPMS)" ]; then diff --git a/pkg/docker-engine/scripts/pkg-static-build.sh b/pkg/docker-engine/scripts/pkg-static-build.sh index baf0f9cf..e2277131 100755 --- a/pkg/docker-engine/scripts/pkg-static-build.sh +++ b/pkg/docker-engine/scripts/pkg-static-build.sh @@ -16,6 +16,9 @@ : "${NIGHTLY_BUILD=}" +: "${DOCKER_PLATFORM_NAME=}" +: "${DOCKER_PRODUCT_LICENSE=}" + : "${PKG_NAME=}" : "${BUILDDIR=/work/build}" @@ -59,7 +62,7 @@ mkdir -p ${BUILDDIR}/${PKG_NAME} ( set -x pushd ${SRCDIR} - CGO_ENABLED=1 VERSION=${GENVER_VERSION#v} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} ./hack/make.sh binary + CGO_ENABLED=1 VERSION=${GENVER_VERSION#v} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} PLATFORM="${DOCKER_PLATFORM_NAME}" DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary mv "./bundles/binary-daemon/dockerd${binext}" "${BUILDDIR}/${PKG_NAME}/" if [ "$(xx-info os)" != "windows" ]; then mv "./bundles/binary-daemon/docker-proxy${binext}" "${BUILDDIR}/${PKG_NAME}/" diff --git a/pkg/docker/Dockerfile b/pkg/docker/Dockerfile index 591c196b..f3979699 100644 --- a/pkg/docker/Dockerfile +++ b/pkg/docker/Dockerfile @@ -155,6 +155,8 @@ ARG PKG_NAME ARG PKG_REF ARG CLI_REF ARG DOCKER_VERSION +ARG DOCKER_PLATFORM_NAME +ARG DOCKER_PRODUCT_LICENSE ARG NIGHTLY_BUILD ARG TAGPREFIX WORKDIR /build diff --git a/pkg/docker/scripts/pkg-static-build.sh b/pkg/docker/scripts/pkg-static-build.sh index 43a864ce..9a8de405 100755 --- a/pkg/docker/scripts/pkg-static-build.sh +++ b/pkg/docker/scripts/pkg-static-build.sh @@ -18,6 +18,9 @@ : "${DOCKER_VERSION=}" +: "${DOCKER_PLATFORM_NAME=}" +: "${DOCKER_PRODUCT_LICENSE=}" + : "${BUILDDIR=/work/build}" : "${ENGINE_SRCDIR=/work/engine-src}" : "${CLI_SRCDIR=/work/cli-src}" @@ -101,7 +104,7 @@ fetch_git_ref() { ( set -x pushd "${ENGINE_SRCDIR}" - CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT_SHORT}" ./hack/make.sh binary + CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT_SHORT}" PLATFORM="${DOCKER_PLATFORM_NAME}" DEFAULT_PRODUCT_LICENSE="${DOCKER_PRODUCT_LICENSE}" ./hack/make.sh binary mv "./bundles/binary-daemon/dockerd${binext}" "${engine_builddir}/" if [ "$(xx-info os)" != "windows" ]; then mv "./bundles/binary-daemon/docker-proxy${binext}" "${engine_builddir}/"