diff --git a/.github/workflows/.build.yml b/.github/workflows/.build.yml index cdc526c3..48f2049d 100644 --- a/.github/workflows/.build.yml +++ b/.github/workflows/.build.yml @@ -19,34 +19,42 @@ jobs: prepare: runs-on: ubuntu-20.04 outputs: - matrix: ${{ steps.pkgs.outputs.matrix }} + pkgs: ${{ steps.set.outputs.pkgs }} + fail-fast: ${{ steps.set.outputs.fail-fast }} steps: - name: Checkout uses: actions/checkout@v3 - - name: Create matrix - id: pkgs + name: Set outputs + id: set run: | ghamatrix=$GHA_DEFAULT_MATRIX if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then ghamatrix=${{ inputs.pkgs }} fi pkgs=$(make gha-matrix GHA_MATRIX=$ghamatrix) - echo "matrix=$pkgs" >> $GITHUB_OUTPUT + echo "pkgs=$pkgs" >> $GITHUB_OUTPUT + if [ "${{ inputs.fail-fast }}" != "" ]; then + failfast=${{ inputs.fail-fast }} + else + failfast=true + fi + echo "fail-fast=$failfast" >> $GITHUB_OUTPUT - - name: Show matrix + name: Show outputs run: | - echo ${{ steps.pkgs.outputs.matrix }} + echo pkgs=${{ steps.set.outputs.pkgs }} + echo fail-fast=${{ steps.set.outputs.fail-fast }} build: runs-on: ubuntu-20.04 needs: - prepare strategy: - fail-fast: false + fail-fast: ${{ needs.prepare.outputs.fail-fast == 'true' }} matrix: - pkg: ${{ fromJson(needs.prepare.outputs.matrix) }} + pkg: ${{ fromJson(needs.prepare.outputs.pkgs) }} steps: - name: Checkout diff --git a/.github/workflows/.release.yml b/.github/workflows/.release.yml index 067ab281..f2cae76e 100644 --- a/.github/workflows/.release.yml +++ b/.github/workflows/.release.yml @@ -22,21 +22,21 @@ jobs: prepare: runs-on: ubuntu-20.04 outputs: - matrix: ${{ steps.pkgs.outputs.matrix }} + pkgs: ${{ steps.set.outputs.pkgs }} steps: - name: Checkout uses: actions/checkout@v3 - - name: Create matrix - id: pkgs + name: Set outputs + id: set run: | pkgs=$(make gha-matrix GHA_MATRIX=all) - echo "matrix=$pkgs" >> $GITHUB_OUTPUT + echo "pkgs=$pkgs" >> $GITHUB_OUTPUT - - name: Show matrix + name: Show outputs run: | - echo ${{ steps.pkgs.outputs.matrix }} + echo pkgs=${{ steps.set.outputs.pkgs }} build: runs-on: ubuntu-20.04 @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: true matrix: - pkg: ${{ fromJson(needs.prepare.outputs.matrix) }} + pkg: ${{ fromJson(needs.prepare.outputs.pkgs) }} steps: - name: Checkout @@ -77,16 +77,16 @@ jobs: - name: aws_graviton2 endpoint: tcp://${{ secrets.AWS_ARM64_HOST }}:1234 platforms: darwin/arm64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,windows/arm64 - - name: linuxone_s390x - endpoint: tcp://${{ secrets.LINUXONE_S390X_HOST }}:1234 - platforms: linux/s390x +# - name: linuxone_s390x +# endpoint: tcp://${{ secrets.LINUXONE_S390X_HOST }}:1234 +# platforms: linux/s390x env: BUILDER_NODE_1_AUTH_TLS_CACERT: ${{ secrets.AWS_ARM64_CACERT }} BUILDER_NODE_1_AUTH_TLS_CERT: ${{ secrets.AWS_ARM64_CERT }} BUILDER_NODE_1_AUTH_TLS_KEY: ${{ secrets.AWS_ARM64_KEY }} - BUILDER_NODE_2_AUTH_TLS_CACERT: ${{ secrets.LINUXONE_S390X_CACERT }} - BUILDER_NODE_2_AUTH_TLS_CERT: ${{ secrets.LINUXONE_S390X_CERT }} - BUILDER_NODE_2_AUTH_TLS_KEY: ${{ secrets.LINUXONE_S390X_KEY }} +# BUILDER_NODE_2_AUTH_TLS_CACERT: ${{ secrets.LINUXONE_S390X_CACERT }} +# BUILDER_NODE_2_AUTH_TLS_CERT: ${{ secrets.LINUXONE_S390X_CERT }} +# BUILDER_NODE_2_AUTH_TLS_KEY: ${{ secrets.LINUXONE_S390X_KEY }} - name: Build run: | diff --git a/.github/workflows/build-buildx.yml b/.github/workflows/build-buildx.yml index 55b1c602..6bc03463 100644 --- a/.github/workflows/build-buildx.yml +++ b/.github/workflows/build-buildx.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-compose.yml b/.github/workflows/build-compose.yml index 5e631578..65851955 100644 --- a/.github/workflows/build-compose.yml +++ b/.github/workflows/build-compose.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-containerd.yml b/.github/workflows/build-containerd.yml index b2503a23..0c20b316 100644 --- a/.github/workflows/build-containerd.yml +++ b/.github/workflows/build-containerd.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-credential-helpers.yml b/.github/workflows/build-credential-helpers.yml index c70f4318..10c780d7 100644 --- a/.github/workflows/build-credential-helpers.yml +++ b/.github/workflows/build-credential-helpers.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-docker-cli.yml b/.github/workflows/build-docker-cli.yml index 664845c5..45dfbc74 100644 --- a/.github/workflows/build-docker-cli.yml +++ b/.github/workflows/build-docker-cli.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-docker-engine.yml b/.github/workflows/build-docker-engine.yml index 1f0f3b64..301cb8c5 100644 --- a/.github/workflows/build-docker-engine.yml +++ b/.github/workflows/build-docker-engine.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-sbom.yml b/.github/workflows/build-sbom.yml index 04d39ea2..57d90812 100644 --- a/.github/workflows/build-sbom.yml +++ b/.github/workflows/build-sbom.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/build-scan.yml b/.github/workflows/build-scan.yml index 06e9fe21..1d9cd1a9 100644 --- a/.github/workflows/build-scan.yml +++ b/.github/workflows/build-scan.yml @@ -12,6 +12,11 @@ on: default: 'minimal' required: false type: string + fail-fast: + description: 'Fail fast' + default: true + required: false + type: boolean push: branches: - 'main' diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml new file mode 100644 index 00000000..4a83a02a --- /dev/null +++ b/.github/workflows/manual-build.yml @@ -0,0 +1,60 @@ +name: manual-build + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + inputs: + projects: + description: 'Projects to build (all or space separated list)' + default: 'all' + required: false + type: string + pkgs: + description: 'Packages to build (minimal, all or space separated list)' + default: 'minimal' + required: false + type: string + fail-fast: + description: 'Fail fast' + required: false + type: boolean + +jobs: + prepare: + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.projects.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Create matrix + id: projects + run: | + if [ "${{ inputs.projects }}" = "all" ]; then + projects=$(find ./pkg -maxdepth 1 -type d -printf '%P ') + else + projects="${{ inputs.projects }}" + fi + projects=$(echo $projects | jq -cR 'split(" ")') + echo "matrix=$projects" >>${GITHUB_OUTPUT} + - + name: Show matrix + run: | + echo ${{ steps.projects.outputs.matrix }} + + build: + uses: ./.github/workflows/.build.yml + needs: + - prepare + strategy: + fail-fast: false + matrix: + project: ${{ fromJson(needs.prepare.outputs.matrix) }} + with: + name: ${{ matrix.project }} + secrets: inherit diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d120331a..4c635f7c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,73 +12,37 @@ on: - cron: '0 1 * * 0' # every sunday at 1am jobs: - buildx: - uses: ./.github/workflows/.release.yml - with: - name: buildx - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - compose: - uses: ./.github/workflows/.release.yml - needs: buildx - with: - name: compose - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - containerd: - uses: ./.github/workflows/.release.yml - needs: compose - with: - name: containerd - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - credential-helpers: - uses: ./.github/workflows/.release.yml - needs: containerd - with: - name: credential-helpers - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - docker-cli: - uses: ./.github/workflows/.release.yml - needs: credential-helpers - with: - name: docker-cli - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - docker-engine: - uses: ./.github/workflows/.release.yml - needs: docker-cli - with: - name: docker-engine - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - sbom: - uses: ./.github/workflows/.release.yml - needs: docker-engine - with: - name: sbom - envs: | - NIGHTLY_BUILD=1 - secrets: inherit - - scan: - uses: ./.github/workflows/.release.yml - needs: sbom - with: - name: scan + prepare: + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.projects.outputs.matrix }} + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Create matrix + id: projects + run: | + projects=$(find ./pkg -maxdepth 1 -type d -printf '%P ') + projects=$(echo $projects | jq -cR 'split(" ")') + echo "matrix=$projects" >>${GITHUB_OUTPUT} + - + name: Show matrix + run: | + echo ${{ steps.projects.outputs.matrix }} + + build: + uses: ./.github/workflows/.release.yml + needs: + - prepare + strategy: + fail-fast: false + max-parallel: 1 + matrix: + project: ${{ fromJson(needs.prepare.outputs.matrix) }} + with: + name: ${{ matrix.project }} envs: | NIGHTLY_BUILD=1 secrets: inherit diff --git a/Makefile b/Makefile index e8f2a64c..51a23ac6 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ include common/packages.mk GHA_MATRIX ?= minimal ifeq ($(GHA_MATRIX),minimal) - GHA_RELEASES := debian10 debian11 debian12 ubuntu1804 ubuntu2004 ubuntu2204 ubuntu2304 centos7 centos9 oraclelinux7 fedora37 static + GHA_RELEASES := debian10 debian11 debian12 ubuntu2004 ubuntu2204 ubuntu2304 centos7 centos9 oraclelinux7 fedora37 fedora38 static else ifeq ($(GHA_MATRIX),all) GHA_RELEASES := $(PKG_DEB_RELEASES) $(PKG_RPM_RELEASES) static else diff --git a/common/packages.hcl b/common/packages.hcl index 02f68007..42614eec 100644 --- a/common/packages.hcl +++ b/common/packages.hcl @@ -130,17 +130,6 @@ target "_pkg-raspbian12" { } } -target "_pkg-ubuntu1804" { - args = { - PKG_RELEASE = "ubuntu1804" - PKG_TYPE = "deb" - PKG_DISTRO = "ubuntu" - PKG_DISTRO_ID = "18.04" - PKG_DISTRO_SUITE = "bionic" - PKG_BASE_IMAGE = "ubuntu:bionic" - } -} - target "_pkg-ubuntu2004" { args = { PKG_RELEASE = "ubuntu2004" @@ -163,17 +152,6 @@ target "_pkg-ubuntu2204" { } } -target "_pkg-ubuntu2210" { - args = { - PKG_RELEASE = "ubuntu2210" - PKG_TYPE = "deb" - PKG_DISTRO = "ubuntu" - PKG_DISTRO_ID = "22.10" - PKG_DISTRO_SUITE = "kinetic" - PKG_BASE_IMAGE = "ubuntu:kinetic" - } -} - target "_pkg-ubuntu2304" { args = { PKG_RELEASE = "ubuntu2304" @@ -218,25 +196,25 @@ target "_pkg-centos9" { } } -target "_pkg-fedora36" { +target "_pkg-fedora37" { args = { - PKG_RELEASE = "fedora36" + PKG_RELEASE = "fedora37" PKG_TYPE = "rpm" PKG_DISTRO = "fedora" - PKG_DISTRO_ID = "36" - PKG_DISTRO_SUITE = "36" - PKG_BASE_IMAGE = "fedora:36" + PKG_DISTRO_ID = "37" + PKG_DISTRO_SUITE = "37" + PKG_BASE_IMAGE = "fedora:37" } } -target "_pkg-fedora37" { +target "_pkg-fedora38" { args = { - PKG_RELEASE = "fedora37" + PKG_RELEASE = "fedora38" PKG_TYPE = "rpm" PKG_DISTRO = "fedora" - PKG_DISTRO_ID = "37" - PKG_DISTRO_SUITE = "37" - PKG_BASE_IMAGE = "fedora:37" + PKG_DISTRO_ID = "38" + PKG_DISTRO_SUITE = "38" + PKG_BASE_IMAGE = "fedora:38" } } diff --git a/common/packages.mk b/common/packages.mk index 25fda83e..e86ca839 100644 --- a/common/packages.mk +++ b/common/packages.mk @@ -15,8 +15,8 @@ # don't forget to add/update pkg-info-* rule and update packages.hcl as well # if you add a new release PKG_APK_RELEASES ?= alpine314 alpine315 alpine316 -PKG_DEB_RELEASES ?= debian10 debian11 debian12 ubuntu1804 ubuntu2004 ubuntu2204 ubuntu2210 ubuntu2304 raspbian10 raspbian11 raspbian12 -PKG_RPM_RELEASES ?= centos7 centos8 centos9 fedora36 fedora37 oraclelinux7 oraclelinux8 oraclelinux9 +PKG_DEB_RELEASES ?= debian10 debian11 debian12 ubuntu2004 ubuntu2204 ubuntu2304 raspbian10 raspbian11 raspbian12 +PKG_RPM_RELEASES ?= centos7 centos8 centos9 fedora37 fedora38 oraclelinux7 oraclelinux8 oraclelinux9 # PKG_SUPPORTED_PLATFORMS could be replaced by: # docker buildx imagetools inspect centos:7 --format "{{json .Manifest}}" | jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)/\(.platform.variant)"' | sed 's#/null$##' | tr '\n' ',' | sed 's#,$##' @@ -118,15 +118,6 @@ pkg-info-raspbian12: $(eval PKG_BASE_IMAGE = balenalib/rpi-raspbian:bookworm) $(eval PKG_SUPPORTED_PLATFORMS = linux/arm/v7) -.PHONY: pkg-info-ubuntu1804 -pkg-info-ubuntu1804: - $(eval PKG_TYPE = deb) - $(eval PKG_DISTRO = ubuntu) - $(eval PKG_DISTRO_ID = 18.04) - $(eval PKG_DISTRO_SUITE = bionic) - $(eval PKG_BASE_IMAGE = ubuntu:bionic) - $(eval PKG_SUPPORTED_PLATFORMS = linux/386 linux/amd64 linux/arm64 linux/arm/v7 linux/ppc64le linux/s390x) - .PHONY: pkg-info-ubuntu2004 pkg-info-ubuntu2004: $(eval PKG_TYPE = deb) @@ -147,16 +138,6 @@ pkg-info-ubuntu2204: @# FIXME: linux/riscv64 is not supported (golang base image does not support riscv64) $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/arm/v7 linux/ppc64le linux/s390x) -.PHONY: pkg-info-ubuntu2210 -pkg-info-ubuntu2210: - $(eval PKG_TYPE = deb) - $(eval PKG_DISTRO = ubuntu) - $(eval PKG_DISTRO_ID = 22.10) - $(eval PKG_DISTRO_SUITE = kinetic) - $(eval PKG_BASE_IMAGE = ubuntu:kinetic) - @# FIXME: linux/riscv64 is not supported (golang base image does not support riscv64) - $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/arm/v7 linux/ppc64le linux/s390x) - .PHONY: pkg-info-ubuntu2304 pkg-info-ubuntu2304: $(eval PKG_TYPE = deb) @@ -196,15 +177,6 @@ pkg-info-centos9: @# FIXME: packages look broken for linux/s390x on centos:stream9 $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/ppc64le) -.PHONY: pkg-info-fedora36 -pkg-info-fedora36: - $(eval PKG_TYPE = rpm) - $(eval PKG_DISTRO = fedora) - $(eval PKG_DISTRO_ID = 36) - $(eval PKG_DISTRO_SUITE = 36) - $(eval PKG_BASE_IMAGE = fedora:36) - $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/ppc64le linux/s390x) - .PHONY: pkg-info-fedora37 pkg-info-fedora37: $(eval PKG_TYPE = rpm) @@ -214,6 +186,15 @@ pkg-info-fedora37: $(eval PKG_BASE_IMAGE = fedora:37) $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/ppc64le linux/s390x) +.PHONY: pkg-info-fedora38 +pkg-info-fedora38: + $(eval PKG_TYPE = rpm) + $(eval PKG_DISTRO = fedora) + $(eval PKG_DISTRO_ID = 38) + $(eval PKG_DISTRO_SUITE = 38) + $(eval PKG_BASE_IMAGE = fedora:38) + $(eval PKG_SUPPORTED_PLATFORMS = linux/amd64 linux/arm64 linux/ppc64le linux/s390x) + .PHONY: pkg-info-oraclelinux7 pkg-info-oraclelinux7: $(eval PKG_TYPE = rpm) diff --git a/common/scripts/rpm-builddep.sh b/common/scripts/rpm-builddep.sh new file mode 100755 index 00000000..4d62b461 --- /dev/null +++ b/common/scripts/rpm-builddep.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Copyright 2023 Docker Packaging authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +arch=$1 +specsDir=$2 + +if [[ -z "$arch" ]] || [[ -z "$specsDir" ]]; then + echo "usage: ./rpm-builddep " >&2 + exit 1 +fi + +set -e + +builddepCmd="" +if command -v dnf &> /dev/null; then + builddepCmd="setarch $arch dnf builddep --nobest" +elif command -v yum-builddep &> /dev/null; then + builddepCmd="yum-builddep --target $arch" +else + echo "unable to detect package manager" >&2 + exit 1 +fi + +set -x +$builddepCmd -y "$specsDir"/*.spec diff --git a/pkg/buildx/Dockerfile b/pkg/buildx/Dockerfile index c80f7bac..fdb569d4 100644 --- a/pkg/buildx/Dockerfile +++ b/pkg/buildx/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -124,20 +124,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG BUILDX_REF ARG NIGHTLY_BUILD diff --git a/pkg/buildx/Makefile b/pkg/buildx/Makefile index 9ca509e2..cec180e8 100644 --- a/pkg/buildx/Makefile +++ b/pkg/buildx/Makefile @@ -26,7 +26,8 @@ export BUILDX_REF := $(if $(BUILDX_REF),$(BUILDX_REF),master) PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/buildx/blob/master/docker-bake.hcl#L110-L122 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 windows/amd64 windows/arm64 .PHONY: default default: pkg ; diff --git a/pkg/buildx/deb/compat b/pkg/buildx/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/buildx/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/buildx/deb/control b/pkg/buildx/deb/control index ea70f9fe..5285e415 100644 --- a/pkg/buildx/deb/control +++ b/pkg/buildx/deb/control @@ -7,7 +7,7 @@ Vcs-Browser: https://github.com/docker/buildx Vcs-Git: git://github.com/docker/buildx.git Standards-Version: 3.9.6 Build-Depends: bash, - debhelper (>= 10~) | dh-systemd + debhelper-compat (= 12) Package: docker-buildx-plugin Priority: optional diff --git a/pkg/buildx/deb/rules b/pkg/buildx/deb/rules index beeb5572..b9991a72 100644 --- a/pkg/buildx/deb/rules +++ b/pkg/buildx/deb/rules @@ -21,6 +21,12 @@ override_dh_auto_test: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-buildx debian/docker-buildx-plugin/usr/libexec/docker/cli-plugins/docker-buildx diff --git a/pkg/buildx/scripts/pkg-deb-build.sh b/pkg/buildx/scripts/pkg-deb-build.sh index 23086398..6fabcb6f 100755 --- a/pkg/buildx/scripts/pkg-deb-build.sh +++ b/pkg/buildx/scripts/pkg-deb-build.sh @@ -66,6 +66,6 @@ mkdir -p "${pkgoutput}" set -x -chmod -x debian/compat debian/control debian/docs +chmod -x debian/control debian/docs VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} 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/compose/Dockerfile b/pkg/compose/Dockerfile index c0928b9e..6dd241b5 100644 --- a/pkg/compose/Dockerfile +++ b/pkg/compose/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -127,20 +127,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG COMPOSE_REF ARG NIGHTLY_BUILD diff --git a/pkg/compose/Makefile b/pkg/compose/Makefile index a29a153c..2f9e47d0 100644 --- a/pkg/compose/Makefile +++ b/pkg/compose/Makefile @@ -26,7 +26,8 @@ export COMPOSE_REF := $(if $(COMPOSE_REF),$(COMPOSE_REF),v2) PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/compose/blob/v2/docker-bake.hcl#L95-L107 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 windows/amd64 windows/arm64 .PHONY: default default: pkg ; diff --git a/pkg/compose/deb/compat b/pkg/compose/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/compose/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/compose/deb/control b/pkg/compose/deb/control index 9330164b..d5e863b9 100644 --- a/pkg/compose/deb/control +++ b/pkg/compose/deb/control @@ -7,7 +7,7 @@ Vcs-Browser: https://github.com/docker/compose Vcs-Git: git://github.com/docker/compose.git Standards-Version: 3.9.6 Build-Depends: bash, - debhelper (>= 10~) | dh-systemd, + debhelper-compat (= 12), make Package: docker-compose-plugin diff --git a/pkg/compose/deb/rules b/pkg/compose/deb/rules index 5fc536e9..f3a2a591 100644 --- a/pkg/compose/deb/rules +++ b/pkg/compose/deb/rules @@ -16,6 +16,12 @@ override_dh_auto_test: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-compose debian/docker-compose-plugin/usr/libexec/docker/cli-plugins/docker-compose diff --git a/pkg/compose/scripts/pkg-deb-build.sh b/pkg/compose/scripts/pkg-deb-build.sh index e2777c51..b3fc0332 100755 --- a/pkg/compose/scripts/pkg-deb-build.sh +++ b/pkg/compose/scripts/pkg-deb-build.sh @@ -70,6 +70,6 @@ mkdir -p "${pkgoutput}" set -x -chmod -x debian/compat debian/control debian/docs +chmod -x debian/control debian/docs VERSION=${GENVER_VERSION} 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/containerd/Dockerfile b/pkg/containerd/Dockerfile index 487fd6ba..b2091e67 100644 --- a/pkg/containerd/Dockerfile +++ b/pkg/containerd/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -161,20 +161,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG CONTAINERD_REF ARG NIGHTLY_BUILD diff --git a/pkg/containerd/Makefile b/pkg/containerd/Makefile index 24d45d10..334a68d9 100644 --- a/pkg/containerd/Makefile +++ b/pkg/containerd/Makefile @@ -32,7 +32,8 @@ PKG_LIST ?= deb rpm static # FIXME: can't build static binaries with containerd Makefile for darwin/amd64 darwin/arm64 windows/amd64 platforms # FIXME: linux/riscv64 needs ubuntu:22.04 image # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 .PHONY: default default: pkg ; diff --git a/pkg/containerd/deb/compat b/pkg/containerd/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/containerd/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/containerd/deb/control b/pkg/containerd/deb/control index 96568ec5..fbb50751 100644 --- a/pkg/containerd/deb/control +++ b/pkg/containerd/deb/control @@ -2,7 +2,7 @@ Source: containerd.io Section: devel Priority: optional Maintainer: Containerd team -Build-Depends: debhelper (>= 10~) | dh-systemd, +Build-Depends: debhelper-compat (= 12), pkg-config, libseccomp-dev Standards-Version: 4.1.4 diff --git a/pkg/containerd/deb/rules b/pkg/containerd/deb/rules index 6699f258..c211e224 100755 --- a/pkg/containerd/deb/rules +++ b/pkg/containerd/deb/rules @@ -15,7 +15,7 @@ # limitations under the License. %: - dh $@ --with systemd + dh $@ # GO_SRC_PATH and PKG_NAME are defined in the dockerfile # VERSION and REF are defined in scripts/build-deb @@ -51,6 +51,12 @@ man: ## Create containerd man pages override_dh_builddeb: dh_builddeb -- -Zxz +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_build: binaries bin/runc man override_dh_systemd_start: diff --git a/pkg/containerd/scripts/pkg-deb-build.sh b/pkg/containerd/scripts/pkg-deb-build.sh index 851254ee..566ce3d7 100755 --- a/pkg/containerd/scripts/pkg-deb-build.sh +++ b/pkg/containerd/scripts/pkg-deb-build.sh @@ -68,6 +68,6 @@ set -x sed 's#/usr/local/bin/containerd#/usr/bin/containerd#g' "${SRCDIR}/containerd.service" > /common/containerd.service -chmod -x debian/compat debian/control debian/copyright debian/manpages +chmod -x debian/control debian/copyright debian/manpages VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) cp /root/${PKG_NAME}* "${pkgoutput}"/ diff --git a/pkg/credential-helpers/Dockerfile b/pkg/credential-helpers/Dockerfile index b8f81d4c..6488920b 100644 --- a/pkg/credential-helpers/Dockerfile +++ b/pkg/credential-helpers/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -123,20 +123,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG CREDENTIAL_HELPERS_REF ARG NIGHTLY_BUILD diff --git a/pkg/credential-helpers/Makefile b/pkg/credential-helpers/Makefile index b343ec75..cb60752f 100644 --- a/pkg/credential-helpers/Makefile +++ b/pkg/credential-helpers/Makefile @@ -26,7 +26,8 @@ export CREDENTIAL_HELPERS_REF := $(if $(CREDENTIAL_HELPERS_REF),$(CREDENTIAL_HEL PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/docker-credential-helpers/blob/master/docker-bake.hcl#L56-L66 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x windows/amd64 +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 windows/amd64 .PHONY: default default: pkg ; diff --git a/pkg/credential-helpers/deb/compat b/pkg/credential-helpers/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/credential-helpers/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/credential-helpers/deb/control b/pkg/credential-helpers/deb/control index a8f5c43d..d0cdd947 100644 --- a/pkg/credential-helpers/deb/control +++ b/pkg/credential-helpers/deb/control @@ -6,7 +6,7 @@ Homepage: https://www.docker.com Vcs-Browser: https://github.com/docker/docker-credential-helpers Vcs-Git: git://github.com/docker/docker-credential-helpers.git Standards-Version: 3.9.6 -Build-Depends: debhelper (>= 10~) | dh-systemd, +Build-Depends: debhelper-compat (= 12), gcc, libsecret-1-dev, make diff --git a/pkg/credential-helpers/deb/rules b/pkg/credential-helpers/deb/rules index f6197cf1..53f47357 100644 --- a/pkg/credential-helpers/deb/rules +++ b/pkg/credential-helpers/deb/rules @@ -11,6 +11,12 @@ override_dh_auto_build: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D bin/docker-credential-secretservice debian/docker-credential-secretservice/usr/bin/docker-credential-secretservice install -D bin/docker-credential-pass debian/docker-credential-pass/usr/bin/docker-credential-pass diff --git a/pkg/credential-helpers/scripts/pkg-deb-build.sh b/pkg/credential-helpers/scripts/pkg-deb-build.sh index 57c20ca6..8a8bb109 100755 --- a/pkg/credential-helpers/scripts/pkg-deb-build.sh +++ b/pkg/credential-helpers/scripts/pkg-deb-build.sh @@ -65,7 +65,7 @@ fi set -x -chmod -x debian/compat debian/control debian/docs +chmod -x debian/control debian/docs VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) mkdir -p "${pkgoutput}" cp /root/docker-credential-* "${pkgoutput}"/ diff --git a/pkg/docker-cli/Dockerfile b/pkg/docker-cli/Dockerfile index b1984ca7..8b7b679e 100644 --- a/pkg/docker-cli/Dockerfile +++ b/pkg/docker-cli/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -96,7 +96,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils bash RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG DOCKER_CLI_REF ARG NIGHTLY_BUILD diff --git a/pkg/docker-cli/Makefile b/pkg/docker-cli/Makefile index 79afcf5c..3c415e2a 100644 --- a/pkg/docker-cli/Makefile +++ b/pkg/docker-cli/Makefile @@ -29,7 +29,8 @@ export PKG_RPM_RELEASE = 3 PKG_LIST ?= deb rpm static # supported platforms: https://github.com/docker/cli/blob/master/docker-bake.hcl#L30-L42 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 linux/s390x windows/amd64 windows/arm64 +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/riscv64 windows/amd64 windows/arm64 .PHONY: default default: pkg ; diff --git a/pkg/docker-cli/deb/compat b/pkg/docker-cli/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/docker-cli/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/docker-cli/deb/control b/pkg/docker-cli/deb/control index ddd60c79..86aa12a1 100644 --- a/pkg/docker-cli/deb/control +++ b/pkg/docker-cli/deb/control @@ -8,7 +8,7 @@ Vcs-Git: git://github.com/docker/cli.git Standards-Version: 3.9.6 Build-Depends: bash, bash-completion, - debhelper (>= 10~) | dh-systemd, + debhelper-compat (= 12), gcc, libc-dev, make diff --git a/pkg/docker-cli/deb/rules b/pkg/docker-cli/deb/rules index ea2c5367..f83a198b 100644 --- a/pkg/docker-cli/deb/rules +++ b/pkg/docker-cli/deb/rules @@ -19,6 +19,12 @@ override_dh_auto_test: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D -m 0644 cli/contrib/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish install -D -m 0644 cli/contrib/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker diff --git a/pkg/docker-cli/scripts/pkg-deb-build.sh b/pkg/docker-cli/scripts/pkg-deb-build.sh index 3c9e1afc..8c7461ea 100755 --- a/pkg/docker-cli/scripts/pkg-deb-build.sh +++ b/pkg/docker-cli/scripts/pkg-deb-build.sh @@ -66,6 +66,6 @@ mkdir -p "${pkgoutput}" set -x -chmod -x debian/compat debian/control debian/docs debian/*.bash-completion debian/*.manpages +chmod -x debian/control debian/docs debian/*.bash-completion debian/*.manpages VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} 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/Dockerfile b/pkg/docker-engine/Dockerfile index 4cc0f70e..e4158c24 100644 --- a/pkg/docker-engine/Dockerfile +++ b/pkg/docker-engine/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -95,7 +95,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils bash RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG DOCKER_ENGINE_REF ARG NIGHTLY_BUILD diff --git a/pkg/docker-engine/Makefile b/pkg/docker-engine/Makefile index 60d3fec3..b4a872be 100644 --- a/pkg/docker-engine/Makefile +++ b/pkg/docker-engine/Makefile @@ -29,7 +29,8 @@ export PKG_RPM_RELEASE = 3 PKG_LIST ?= deb rpm static # supported platforms: https://github.com/moby/moby/blob/master/docker-bake.hcl#L93-L101 # FIXME: add linux/ppc64le when a remote PowerPC instance is available (too slow with QEMU) -PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 linux/s390x windows/amd64 +# FIXME: add linux/s390x when remote instance is reachable again (too slow with QEMU) +PKG_PLATFORMS ?= linux/amd64 linux/arm/v5 linux/arm/v6 linux/arm/v7 linux/arm64 windows/amd64 .PHONY: default default: pkg ; diff --git a/pkg/docker-engine/deb/compat b/pkg/docker-engine/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/docker-engine/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/docker-engine/deb/control b/pkg/docker-engine/deb/control index dade8bf2..19a6bcc4 100644 --- a/pkg/docker-engine/deb/control +++ b/pkg/docker-engine/deb/control @@ -9,7 +9,7 @@ Standards-Version: 3.9.6 Build-Depends: ca-certificates, cmake, dh-apparmor, - debhelper (>= 10~) | dh-systemd, + debhelper-compat (= 12), gcc, libc-dev, libdevmapper-dev, diff --git a/pkg/docker-engine/deb/docker-ce.docker.upstart b/pkg/docker-engine/deb/docker-ce.docker.upstart deleted file mode 100644 index d58f7d6a..00000000 --- a/pkg/docker-engine/deb/docker-ce.docker.upstart +++ /dev/null @@ -1,72 +0,0 @@ -description "Docker daemon" - -start on (filesystem and net-device-up IFACE!=lo) -stop on runlevel [!2345] - -limit nofile 524288 1048576 - -# Having non-zero limits causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -limit nproc unlimited unlimited - -respawn - -kill timeout 20 - -pre-start script - # see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount - if grep -v '^#' /etc/fstab | grep -q cgroup \ - || [ ! -e /proc/cgroups ] \ - || [ ! -d /sys/fs/cgroup ]; then - exit 0 - fi - if ! mountpoint -q /sys/fs/cgroup; then - mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup - fi - ( - cd /sys/fs/cgroup - for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do - mkdir -p $sys - if ! mountpoint -q $sys; then - if ! mount -n -t cgroup -o $sys cgroup $sys; then - rmdir $sys || true - fi - fi - done - ) -end script - -script - # modify these in /etc/default/$UPSTART_JOB (/etc/default/docker) - DOCKERD=/usr/bin/dockerd - DOCKER_OPTS= - if [ -f /etc/default/$UPSTART_JOB ]; then - . /etc/default/$UPSTART_JOB - fi - exec "$DOCKERD" $DOCKER_OPTS --raw-logs -end script - -# Don't emit "started" event until docker.sock is ready. -# See https://github.com/docker/docker/issues/6647 -post-start script - DOCKER_OPTS= - DOCKER_SOCKET= - if [ -f /etc/default/$UPSTART_JOB ]; then - . /etc/default/$UPSTART_JOB - fi - - if ! printf "%s" "$DOCKER_OPTS" | grep -qE -e '-H|--host'; then - DOCKER_SOCKET=/var/run/docker.sock - else - DOCKER_SOCKET=$(printf "%s" "$DOCKER_OPTS" | grep -oP -e '(-H|--host)\W*unix://\K(\S+)' | sed 1q) - fi - - if [ -n "$DOCKER_SOCKET" ]; then - while ! [ -e "$DOCKER_SOCKET" ]; do - initctl status $UPSTART_JOB | grep -qE "(stop|respawn)/" && exit 1 - echo "Waiting for $DOCKER_SOCKET" - sleep 0.1 - done - echo "$DOCKER_SOCKET is up" - fi -end script diff --git a/pkg/docker-engine/deb/docker-ce.maintscript b/pkg/docker-engine/deb/docker-ce.maintscript new file mode 100644 index 00000000..6ca08142 --- /dev/null +++ b/pkg/docker-engine/deb/docker-ce.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/init/docker.conf 5:24.0.5-1~ \ No newline at end of file diff --git a/pkg/docker-engine/deb/rules b/pkg/docker-engine/deb/rules index 35c713a5..a3770065 100755 --- a/pkg/docker-engine/deb/rules +++ b/pkg/docker-engine/deb/rules @@ -19,6 +19,12 @@ override_dh_auto_test: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D -m 0644 /common/systemd/docker.service debian/docker-ce/lib/systemd/system/docker.service install -D -m 0644 /common/systemd/docker.socket debian/docker-ce/lib/systemd/system/docker.socket @@ -37,6 +43,10 @@ override_dh_installinit: # use "docker" as our service name, not "docker-ce" dh_installinit --name=docker +override_dh_installsystemd: + # use "docker" as our service name, not "docker-ce" + dh_installsystemd --name=docker + override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info diff --git a/pkg/docker-engine/scripts/pkg-deb-build.sh b/pkg/docker-engine/scripts/pkg-deb-build.sh index 02295196..8efee749 100755 --- a/pkg/docker-engine/scripts/pkg-deb-build.sh +++ b/pkg/docker-engine/scripts/pkg-deb-build.sh @@ -66,6 +66,6 @@ mkdir -p "${pkgoutput}" set -x -chmod -x debian/compat debian/control debian/docs +chmod -x debian/control debian/docs VERSION=${GENVER_VERSION} 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/sbom/Dockerfile b/pkg/sbom/Dockerfile index e777084e..e8878717 100644 --- a/pkg/sbom/Dockerfile +++ b/pkg/sbom/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -124,20 +124,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG SBOM_REF ARG NIGHTLY_BUILD diff --git a/pkg/sbom/deb/compat b/pkg/sbom/deb/compat deleted file mode 100644 index f599e28b..00000000 --- a/pkg/sbom/deb/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/pkg/sbom/deb/control b/pkg/sbom/deb/control index dd5da3d3..4fc290c3 100644 --- a/pkg/sbom/deb/control +++ b/pkg/sbom/deb/control @@ -7,7 +7,7 @@ Vcs-Browser: https://github.com/docker/sbom-cli-plugin Vcs-Git: git://github.com/docker/sbom-cli-plugin.git Standards-Version: 3.9.6 Build-Depends: bash, - debhelper (>= 10~) | dh-systemd, + debhelper-compat (= 12), make Package: docker-sbom-plugin diff --git a/pkg/sbom/deb/rules b/pkg/sbom/deb/rules index 51fb6b66..9ffb368f 100644 --- a/pkg/sbom/deb/rules +++ b/pkg/sbom/deb/rules @@ -19,6 +19,12 @@ override_dh_auto_test: override_dh_strip: # Go has lots of problems with stripping, so just don't +# http://manpages.debian.org/dh_dwz +override_dh_dwz: + # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) + @# https://packages.debian.org/debhelper + @# https://packages.ubuntu.com/debhelper + override_dh_auto_install: install -D -m 0755 /usr/libexec/docker/cli-plugins/docker-sbom debian/docker-sbom-plugin/usr/libexec/docker/cli-plugins/docker-sbom diff --git a/pkg/sbom/scripts/pkg-deb-build.sh b/pkg/sbom/scripts/pkg-deb-build.sh index 23086398..6fabcb6f 100755 --- a/pkg/sbom/scripts/pkg-deb-build.sh +++ b/pkg/sbom/scripts/pkg-deb-build.sh @@ -66,6 +66,6 @@ mkdir -p "${pkgoutput}" set -x -chmod -x debian/compat debian/control debian/docs +chmod -x debian/control debian/docs VERSION=${GENVER_VERSION} REVISION=${GENVER_COMMIT} 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/scan/Dockerfile b/pkg/scan/Dockerfile index 454618a6..c5cd4715 100644 --- a/pkg/scan/Dockerfile +++ b/pkg/scan/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile-upstream:1 +# syntax=docker/dockerfile:1 # Copyright 2022 Docker Packaging authors # @@ -124,20 +124,8 @@ RUN --mount=type=bind,from=common-scripts,source=rpm-init.sh,target=/usr/local/b rpm-init $PKG_RELEASE COPY rpm /root/rpmbuild/SPECS ARG TARGETPLATFORM -RUN < /dev/null; then - builddepCmd="setarch $(xx-info rhel-arch) dnf builddep" - elif command -v yum-builddep &> /dev/null; then - builddepCmd="yum-builddep --target $(xx-info rhel-arch)" - else - echo >&2 "unable to detect package manager" - exit 1 - fi - set -x - $builddepCmd -y /root/rpmbuild/SPECS/*.spec -EOT +RUN --mount=type=bind,from=common-scripts,source=rpm-builddep.sh,target=/usr/local/bin/rpm-builddep \ + rpm-builddep $(xx-info rhel-arch) /root/rpmbuild/SPECS WORKDIR /root/rpmbuild ARG SCAN_REF ARG NIGHTLY_BUILD