use bake targets and makefile rules inheritance to create releases

also change directory structure from `<os>/<arch>[/<variant>]`
to `<pkgtype>/[<pkgdistro>/<pkgsuite>/]<arch>[/<variant>]` so
we are almost aligned with https://download.docker.com.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-09-01 13:48:10 +02:00
Родитель c1765c1b1c
Коммит a6805b98e3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 3248E46B6BB8C7F7
13 изменённых файлов: 966 добавлений и 245 удалений

5
.github/workflows/build.yml поставляемый
Просмотреть файл

@ -44,5 +44,8 @@ jobs:
-
name: Build
run: |
make -j 4 -C pkg/${{ matrix.pkg }} pkg
make -C pkg/${{ matrix.pkg }} all
-
name: List artifacts
run: |
tree -nh ./pkg/${{ matrix.pkg }}/bin

2
.github/workflows/release.yml поставляемый
Просмотреть файл

@ -41,7 +41,7 @@ jobs:
-
name: Build pkgs
run: |
make -j 4 -C pkg/${{ inputs.package }} pkg
make -C pkg/${{ inputs.package }} all
tree -nh ./pkg/${{ inputs.package }}/bin
-
name: Docker meta

Просмотреть файл

@ -22,16 +22,16 @@ apk deb rpm static:
.PHONY: apk-%
apk-%:
$(MAKE) -C pkg/$* $(foreach release,$(PKG_APK_RELEASES),build-cross-apk-$(release))
$(MAKE) -C pkg/$* pkg-apk
.PHONY: deb-%
deb-%:
$(MAKE) -C pkg/$* $(foreach release,$(PKG_DEB_RELEASES),build-cross-deb-$(release))
$(MAKE) -C pkg/$* pkg-deb
.PHONY: rpm-%
rpm-%:
$(MAKE) -C pkg/$* $(foreach release,$(PKG_RPM_RELEASES),build-cross-rpm-$(release))
$(MAKE) -C pkg/$* pkg-rpm
.PHONY: static-%
static-%:
$(MAKE) -C pkg/$* build-cross-static
$(MAKE) -C pkg/$* pkg-static

462
README.md
Просмотреть файл

@ -46,133 +46,347 @@ $ undock --wrap --rm-dist --all dockereng/packaging:buildx-v0.9.1 ./bin/undock
<summary>tree ./bin/undock</summary>
```
./bin/undock
├── darwin
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ └── arm64
│ └── docker-buildx-plugin_0.9.1.tgz
├── linux
│ ├── amd64
│ │ ├── docker-buildx-plugin-0.9.1-centos7.x86_64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-centos8.x86_64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora33.x86_64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora34.x86_64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora35.x86_64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora36.x86_64.rpm
│ │ ├── docker-buildx-plugin_0.9.1-debian10_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-debian11_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-r0_x86_64.apk
│ │ ├── docker-buildx-plugin_0.9.1-raspbian10_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-raspbian11_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_amd64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_amd64.deb
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ ├── arm
│ │ ├── v6
│ │ │ ├── docker-buildx-plugin-0.9.1-centos7.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin-0.9.1-centos8.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin-0.9.1-fedora33.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin-0.9.1-fedora34.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin-0.9.1-fedora35.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin-0.9.1-fedora36.armv6hl.rpm
│ │ │ ├── docker-buildx-plugin_0.9.1-debian10_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-debian11_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-r0_armhf.apk
│ │ │ ├── docker-buildx-plugin_0.9.1-raspbian10_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-raspbian11_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_armel.deb
│ │ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_armel.deb
./bin/undock/
├── alpine
│ ├── 3.14
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1-0_x86_64.apk
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin_0.9.1-0_armhf.apk
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin_0.9.1-0_armv7.apk
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin_0.9.1-0_aarch64.apk
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin_0.9.1-0_ppc64le.apk
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin_0.9.1-0_riscv64.apk
│ │ └── s390x
│ │ └── docker-buildx-plugin_0.9.1-0_s390x.apk
│ ├── 3.15
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1-0_x86_64.apk
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin_0.9.1-0_armhf.apk
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin_0.9.1-0_armv7.apk
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin_0.9.1-0_aarch64.apk
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin_0.9.1-0_ppc64le.apk
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin_0.9.1-0_riscv64.apk
│ │ └── s390x
│ │ └── docker-buildx-plugin_0.9.1-0_s390x.apk
│ └── 3.16
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1-0_x86_64.apk
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin_0.9.1-0_armhf.apk
│ │ └── v7
│ │ └── docker-buildx-plugin_0.9.1-0_armv7.apk
│ ├── arm64
│ │ └── docker-buildx-plugin_0.9.1-0_aarch64.apk
│ ├── ppc64le
│ │ └── docker-buildx-plugin_0.9.1-0_ppc64le.apk
│ ├── riscv64
│ │ └── docker-buildx-plugin_0.9.1-0_riscv64.apk
│ └── s390x
│ └── docker-buildx-plugin_0.9.1-0_s390x.apk
├── centos
│ ├── 7
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ ├── 8
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ └── 9
│ ├── amd64
│ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ └── v7
│ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ ├── arm64
│ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ ├── ppc64le
│ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ ├── riscv64
│ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ └── s390x
│ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
├── debian
│ ├── bullseye
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ │ └── s390x
│ │ └── docker-buildx-plugin_0.9.1-0_s390x.deb
│ └── buster
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ └── v7
│ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ ├── arm64
│ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ ├── ppc64le
│ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ ├── riscv64
│ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ └── s390x
│ └── docker-buildx-plugin_0.9.1-0_s390x.deb
├── fedora
│ ├── 35
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ ├── 36
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ └── 37
│ ├── amd64
│ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ └── v7
│ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ ├── arm64
│ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ ├── ppc64le
│ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ ├── riscv64
│ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ └── s390x
│ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
├── oraclelinux
│ ├── 7
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ ├── 8
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ │ └── s390x
│ │ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
│ └── 9
│ ├── amd64
│ │ └── docker-buildx-plugin-0.9.1-0.x86_64.rpm
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin-0.9.1-0.armv6hl.rpm
│ │ └── v7
│ │ └── docker-buildx-plugin-0.9.1-0.armv7hl.rpm
│ ├── arm64
│ │ └── docker-buildx-plugin-0.9.1-0.aarch64.rpm
│ ├── ppc64le
│ │ └── docker-buildx-plugin-0.9.1-0.ppc64le.rpm
│ ├── riscv64
│ │ └── docker-buildx-plugin-0.9.1-0.riscv64.rpm
│ └── s390x
│ └── docker-buildx-plugin-0.9.1-0.s390x.rpm
├── raspbian
│ ├── bullseye
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ │ └── s390x
│ │ └── docker-buildx-plugin_0.9.1-0_s390x.deb
│ └── buster
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ └── v7
│ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ ├── arm64
│ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ ├── ppc64le
│ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ ├── riscv64
│ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ └── s390x
│ └── docker-buildx-plugin_0.9.1-0_s390x.deb
├── static
│ ├── darwin
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ └── v7
│ │ ├── docker-buildx-plugin-0.9.1-centos7.armv7hl.rpm
│ │ ├── docker-buildx-plugin-0.9.1-centos8.armv7hl.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora33.armv7hl.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora34.armv7hl.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora35.armv7hl.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora36.armv7hl.rpm
│ │ ├── docker-buildx-plugin_0.9.1-debian10_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-debian11_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-r0_armv7.apk
│ │ ├── docker-buildx-plugin_0.9.1-raspbian10_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-raspbian11_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_armhf.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_armhf.deb
│ │ └── arm64
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ ├── arm64
│ │ ├── docker-buildx-plugin-0.9.1-centos7.aarch64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-centos8.aarch64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora33.aarch64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora34.aarch64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora35.aarch64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora36.aarch64.rpm
│ │ ├── docker-buildx-plugin_0.9.1-debian10_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-debian11_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-r0_aarch64.apk
│ │ ├── docker-buildx-plugin_0.9.1-raspbian10_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-raspbian11_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_arm64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_arm64.deb
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ ├── ppc64le
│ │ ├── docker-buildx-plugin-0.9.1-centos7.ppc64le.rpm
│ │ ├── docker-buildx-plugin-0.9.1-centos8.ppc64le.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora33.ppc64le.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora34.ppc64le.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora35.ppc64le.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora36.ppc64le.rpm
│ │ ├── docker-buildx-plugin_0.9.1-debian10_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-debian11_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-r0_ppc64le.apk
│ │ ├── docker-buildx-plugin_0.9.1-raspbian10_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-raspbian11_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_ppc64el.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_ppc64el.deb
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ ├── riscv64
│ │ ├── docker-buildx-plugin-0.9.1-centos7.riscv64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-centos8.riscv64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora33.riscv64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora34.riscv64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora35.riscv64.rpm
│ │ ├── docker-buildx-plugin-0.9.1-fedora36.riscv64.rpm
│ │ ├── docker-buildx-plugin_0.9.1-debian10_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-debian11_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-r0_riscv64.apk
│ │ ├── docker-buildx-plugin_0.9.1-raspbian10_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-raspbian11_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu1804_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2004_riscv64.deb
│ │ ├── docker-buildx-plugin_0.9.1-ubuntu2204_riscv64.deb
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ └── s390x
│ ├── docker-buildx-plugin-0.9.1-centos7.s390x.rpm
│ ├── docker-buildx-plugin-0.9.1-centos8.s390x.rpm
│ ├── docker-buildx-plugin-0.9.1-fedora33.s390x.rpm
│ ├── docker-buildx-plugin-0.9.1-fedora34.s390x.rpm
│ ├── docker-buildx-plugin-0.9.1-fedora35.s390x.rpm
│ ├── docker-buildx-plugin-0.9.1-fedora36.s390x.rpm
│ ├── docker-buildx-plugin_0.9.1-debian10_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-debian11_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-r0_s390x.apk
│ ├── docker-buildx-plugin_0.9.1-raspbian10_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-raspbian11_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-ubuntu1804_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-ubuntu2004_s390x.deb
│ ├── docker-buildx-plugin_0.9.1-ubuntu2204_s390x.deb
│ └── docker-buildx-plugin_0.9.1.tgz
└── windows
├── amd64
│ └── docker-buildx-plugin_0.9.1.zip
└── arm64
└── docker-buildx-plugin_0.9.1.zip
│ ├── linux
│ │ ├── amd64
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ ├── arm
│ │ │ ├── v6
│ │ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ │ └── v7
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ ├── arm64
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ ├── ppc64le
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ ├── riscv64
│ │ │ └── docker-buildx-plugin_0.9.1.tgz
│ │ └── s390x
│ │ └── docker-buildx-plugin_0.9.1.tgz
│ └── windows
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1.zip
│ └── arm64
│ └── docker-buildx-plugin_0.9.1.zip
└── ubuntu
├── bionic
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ └── v7
│ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ ├── arm64
│ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ ├── ppc64le
│ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ ├── riscv64
│ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ └── s390x
│ └── docker-buildx-plugin_0.9.1-0_s390x.deb
├── focal
│ ├── amd64
│ │ └── docker-buildx-plugin_0.9.1-0_amd64.deb
│ ├── arm
│ │ ├── v6
│ │ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ │ └── v7
│ │ └── docker-buildx-plugin_0.9.1-0_armhf.deb
│ ├── arm64
│ │ └── docker-buildx-plugin_0.9.1-0_arm64.deb
│ ├── ppc64le
│ │ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
│ ├── riscv64
│ │ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
│ └── s390x
│ └── docker-buildx-plugin_0.9.1-0_s390x.deb
└── jammy
├── amd64
│ └── docker-buildx-plugin_0.9.1-0_amd64.deb
├── arm
│ ├── v6
│ │ └── docker-buildx-plugin_0.9.1-0_armel.deb
│ └── v7
│ └── docker-buildx-plugin_0.9.1-0_armhf.deb
├── arm64
│ └── docker-buildx-plugin_0.9.1-0_arm64.deb
├── ppc64le
│ └── docker-buildx-plugin_0.9.1-0_ppc64el.deb
├── riscv64
│ └── docker-buildx-plugin_0.9.1-0_riscv64.deb
└── s390x
└── docker-buildx-plugin_0.9.1-0_s390x.deb
15 directories, 109 files
194 directories, 144 files
```
</details>

229
packages.hcl Normal file
Просмотреть файл

@ -0,0 +1,229 @@
// Copyright 2022 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.
variable "PKG_RELEASE" {
default = ""
}
variable "PKG_TYPE" {
default = ""
}
variable "PKG_DISTRO" {
default = ""
}
variable "PKG_SUITE" {
default = ""
}
variable "PKG_BASE_IMAGE" {
default = ""
}
target "_pkg-alpine314" {
args = {
PKG_RELEASE = "alpine314"
PKG_TYPE = "apk"
PKG_DISTRO = "alpine"
PKG_SUITE = "3.14"
PKG_BASE_IMAGE = "alpine:3.14"
}
}
target "_pkg-alpine315" {
args = {
PKG_RELEASE = "alpine315"
PKG_TYPE = "apk"
PKG_DISTRO = "alpine"
PKG_SUITE = "3.15"
PKG_BASE_IMAGE = "alpine:3.15"
}
}
target "_pkg-alpine316" {
args = {
PKG_RELEASE = "alpine316"
PKG_TYPE = "apk"
PKG_DISTRO = "alpine"
PKG_SUITE = "3.16"
PKG_BASE_IMAGE = "alpine:3.16"
}
}
target "_pkg-debian10" {
args = {
PKG_RELEASE = "debian10"
PKG_TYPE = "deb"
PKG_DISTRO = "debian"
PKG_SUITE = "buster"
PKG_BASE_IMAGE = "debian:buster"
}
}
target "_pkg-debian11" {
args = {
PKG_RELEASE = "debian11"
PKG_TYPE = "deb"
PKG_DISTRO = "debian"
PKG_SUITE = "bullseye"
PKG_BASE_IMAGE = "debian:bullseye"
}
}
target "_pkg-raspbian10" {
args = {
PKG_RELEASE = "raspbian10"
PKG_TYPE = "deb"
PKG_DISTRO = "raspbian"
PKG_SUITE = "buster"
PKG_BASE_IMAGE = "balenalib/rpi-raspbian:buster"
}
}
target "_pkg-raspbian11" {
args = {
PKG_RELEASE = "raspbian11"
PKG_TYPE = "deb"
PKG_DISTRO = "raspbian"
PKG_SUITE = "bullseye"
PKG_BASE_IMAGE = "balenalib/rpi-raspbian:bullseye"
}
}
target "_pkg-ubuntu1804" {
args = {
PKG_RELEASE = "ubuntu1804"
PKG_TYPE = "deb"
PKG_DISTRO = "ubuntu"
PKG_SUITE = "bionic"
PKG_BASE_IMAGE = "ubuntu:bionic"
}
}
target "_pkg-ubuntu2004" {
args = {
PKG_RELEASE = "ubuntu2004"
PKG_TYPE = "deb"
PKG_DISTRO = "ubuntu"
PKG_SUITE = "focal"
PKG_BASE_IMAGE = "ubuntu:focal"
}
}
target "_pkg-ubuntu2204" {
args = {
PKG_RELEASE = "ubuntu2204"
PKG_TYPE = "deb"
PKG_DISTRO = "ubuntu"
PKG_SUITE = "jammy"
PKG_BASE_IMAGE = "ubuntu:jammy"
}
}
target "_pkg-centos7" {
args = {
PKG_RELEASE = "centos7"
PKG_TYPE = "rpm"
PKG_DISTRO = "centos"
PKG_SUITE = "7"
PKG_BASE_IMAGE = "centos:7"
}
}
target "_pkg-centos8" {
args = {
PKG_RELEASE = "centos8"
PKG_TYPE = "rpm"
PKG_DISTRO = "centos"
PKG_SUITE = "8"
PKG_BASE_IMAGE = "quay.io/centos/centos:stream8"
}
}
target "_pkg-centos9" {
args = {
PKG_RELEASE = "centos9"
PKG_TYPE = "rpm"
PKG_DISTRO = "centos"
PKG_SUITE = "9"
PKG_BASE_IMAGE = "quay.io/centos/centos:stream9"
}
}
target "_pkg-fedora35" {
args = {
PKG_RELEASE = "fedora35"
PKG_TYPE = "rpm"
PKG_DISTRO = "fedora"
PKG_SUITE = "35"
PKG_BASE_IMAGE = "fedora:35"
}
}
target "_pkg-fedora36" {
args = {
PKG_RELEASE = "fedora36"
PKG_TYPE = "rpm"
PKG_DISTRO = "fedora"
PKG_SUITE = "36"
PKG_BASE_IMAGE = "fedora:36"
}
}
target "_pkg-fedora37" {
args = {
PKG_RELEASE = "fedora37"
PKG_TYPE = "rpm"
PKG_DISTRO = "fedora"
PKG_SUITE = "37"
PKG_BASE_IMAGE = "fedora:37"
}
}
target "_pkg-oraclelinux7" {
args = {
PKG_RELEASE = "oraclelinux7"
PKG_TYPE = "rpm"
PKG_DISTRO = "oraclelinux"
PKG_SUITE = "7"
PKG_BASE_IMAGE = "oraclelinux:7"
}
}
target "_pkg-oraclelinux8" {
args = {
PKG_RELEASE = "oraclelinux8"
PKG_TYPE = "rpm"
PKG_DISTRO = "oraclelinux"
PKG_SUITE = "8"
PKG_BASE_IMAGE = "oraclelinux:8"
}
}
target "_pkg-oraclelinux9" {
args = {
PKG_RELEASE = "oraclelinux9"
PKG_TYPE = "rpm"
PKG_DISTRO = "oraclelinux"
PKG_SUITE = "9"
PKG_BASE_IMAGE = "oraclelinux:9"
}
}
target "_pkg-static" {
args = {
PKG_RELEASE = ""
PKG_TYPE = "static"
PKG_DISTRO = "static"
PKG_SUITE = ""
PKG_BASE_IMAGE = "debian:bullseye"
}
}

203
packages.mk Normal file
Просмотреть файл

@ -0,0 +1,203 @@
# Copyright 2022 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.
# 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 ubuntu1804 ubuntu2004 ubuntu2204 raspbian10 raspbian11
PKG_RPM_RELEASES ?= centos7 centos8 centos9 fedora35 fedora36 fedora37 oraclelinux7 oraclelinux8 oraclelinux9
.PHONY: pkg-releases
pkg-releases:
$(info $$PKG_RELEASES = $(PKG_RELEASES))
.PHONY: pkg-apk-releases
pkg-apk-releases:
$(eval PKG_RELEASES = $(PKG_APK_RELEASES))
.PHONY: pkg-deb-releases
pkg-deb-releases:
$(eval PKG_RELEASES = $(PKG_DEB_RELEASES))
.PHONY: pkg-rpm-releases
pkg-rpm-releases:
$(eval PKG_RELEASES = $(PKG_RPM_RELEASES))
.PHONY: pkg-info
pkg-info:
$(info $$PKG_TYPE = $(PKG_TYPE))
$(info $$PKG_DISTRO = $(PKG_DISTRO))
$(info $$PKG_SUITE = $(PKG_SUITE))
$(info $$PKG_BASE_IMAGE = $(PKG_BASE_IMAGE))
$(info $$PKG_SUPPORTED_ARCHS = $(PKG_SUPPORTED_ARCHS))
.PHONY: pkg-info-alpine314
pkg-info-alpine314:
$(eval PKG_TYPE = apk)
$(eval PKG_DISTRO = alpine)
$(eval PKG_SUITE = 3.14)
$(eval PKG_BASE_IMAGE = alpine:3.14)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l armv6l armv5l ppc64le s390x)
.PHONY: pkg-info-alpine315
pkg-info-alpine315:
$(eval PKG_TYPE = apk)
$(eval PKG_DISTRO = alpine)
$(eval PKG_SUITE = 3.15)
$(eval PKG_BASE_IMAGE = alpine:3.15)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l armv6l armv5l ppc64le s390x)
.PHONY: pkg-info-alpine316
pkg-info-alpine316:
$(eval PKG_TYPE = apk)
$(eval PKG_DISTRO = alpine)
$(eval PKG_SUITE = 3.16)
$(eval PKG_BASE_IMAGE = alpine:3.16)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l armv6l armv5l ppc64le s390x)
.PHONY: pkg-info-debian10
pkg-info-debian10:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = debian)
$(eval PKG_SUITE = buster)
$(eval PKG_BASE_IMAGE = debian:buster)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l armv6l ppc64le riscv64 s390x)
.PHONY: pkg-info-debian11
pkg-info-debian11:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = debian)
$(eval PKG_SUITE = bullseye)
$(eval PKG_BASE_IMAGE = debian:bullseye)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l armv6l ppc64le riscv64 s390x)
.PHONY: pkg-info-raspbian10
pkg-info-raspbian10:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = raspbian)
$(eval PKG_SUITE = buster)
$(eval PKG_BASE_IMAGE = raspbian:buster)
$(eval PKG_SUPPORTED_ARCHS = armv6l)
.PHONY: pkg-info-raspbian11
pkg-info-raspbian11:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = raspbian)
$(eval PKG_SUITE = bullseye)
$(eval PKG_BASE_IMAGE = raspbian:bullseye)
$(eval PKG_SUPPORTED_ARCHS = armv6l)
.PHONY: pkg-info-ubuntu1804
pkg-info-ubuntu1804:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = ubuntu)
$(eval PKG_SUITE = bionic)
$(eval PKG_BASE_IMAGE = ubuntu:bionic)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l ppc64le s390x)
.PHONY: pkg-info-ubuntu2004
pkg-info-ubuntu2004:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = ubuntu)
$(eval PKG_SUITE = focal)
$(eval PKG_BASE_IMAGE = ubuntu:focal)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64 armv7l ppc64le riscv64 s390x)
.PHONY: pkg-info-ubuntu2204
pkg-info-ubuntu2204:
$(eval PKG_TYPE = deb)
$(eval PKG_DISTRO = ubuntu)
$(eval PKG_SUITE = jammy)
$(eval PKG_BASE_IMAGE = ubuntu:jammy)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64 armv7l ppc64le riscv64 s390x)
.PHONY: pkg-info-centos7
pkg-info-centos7:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = centos)
$(eval PKG_SUITE = 7)
$(eval PKG_BASE_IMAGE = centos:7)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 armv7l ppc64le)
.PHONY: pkg-info-centos8
pkg-info-centos8:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = centos)
$(eval PKG_SUITE = 8)
$(eval PKG_BASE_IMAGE = quay.io/centos/centos:stream8)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 ppc64le)
.PHONY: pkg-info-centos9
pkg-info-centos9:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = centos)
$(eval PKG_SUITE = 9)
$(eval PKG_BASE_IMAGE = quay.io/centos/centos:stream9)
$(eval PKG_SUPPORTED_ARCHS = i386 x86_64 aarch64 arm64 ppc64le s390x)
.PHONY: pkg-info-fedora35
pkg-info-fedora35:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = fedora)
$(eval PKG_SUITE = 35)
$(eval PKG_BASE_IMAGE = fedora:35)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64 armv7l ppc64le s390x)
.PHONY: pkg-info-fedora36
pkg-info-fedora36:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = fedora)
$(eval PKG_SUITE = 36)
$(eval PKG_BASE_IMAGE = fedora:36)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64 armv7l ppc64le s390x)
.PHONY: pkg-info-fedora37
pkg-info-fedora37:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = fedora)
$(eval PKG_SUITE = 37)
$(eval PKG_BASE_IMAGE = fedora:37)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64 ppc64le s390x)
.PHONY: pkg-info-oraclelinux7
pkg-info-oraclelinux7:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = oraclelinux)
$(eval PKG_SUITE = 7)
$(eval PKG_BASE_IMAGE = oraclelinux:7)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64)
.PHONY: pkg-info-oraclelinux8
pkg-info-oraclelinux8:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = oraclelinux)
$(eval PKG_SUITE = 8)
$(eval PKG_BASE_IMAGE = oraclelinux:8)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64)
.PHONY: pkg-info-oraclelinux9
pkg-info-oraclelinux9:
$(eval PKG_TYPE = rpm)
$(eval PKG_DISTRO = oraclelinux)
$(eval PKG_SUITE = 9)
$(eval PKG_BASE_IMAGE = oraclelinux:9)
$(eval PKG_SUPPORTED_ARCHS = x86_64 aarch64 arm64)
.PHONY: pkg-info-static
pkg-info-static:
$(eval PKG_TYPE = static)
$(eval PKG_DISTRO = static)
$(eval PKG_SUITE =)
$(eval PKG_BASE_IMAGE = debian:bullseye)
$(eval PKG_SUPPORTED_ARCHS =)

Просмотреть файл

@ -19,6 +19,13 @@ ARG NFPM_VERSION="2.15.1"
ARG XX_VERSION="1.1.2"
ARG MODE="download"
# pkg matrix
ARG PKG_RELEASE="debian11"
ARG PKG_TYPE="deb"
ARG PKG_DISTRO="debian"
ARG PKG_SUITE="bullseye"
ARG PKG_BASE_IMAGE="debian:bullseye"
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS base
RUN apk add --no-cache bash curl file git zip tar
@ -61,10 +68,13 @@ COPY --from=binary /out/buildx /usr/bin/buildx
ARG MODE
ARG BUILDX_VERSION
ARG PKG_NAME
ARG PKG_TYPE
ARG PKG_RELEASE
ARG PKG_VENDOR
ARG PKG_TYPE
ARG PKG_DISTRO
ARG PKG_SUITE
ARG PKG_PACKAGER
ARG PKG_VENDOR
ARG PKG_REVISION
ARG PKG_OUTPUT=/build
ARG TARGETPLATFORM
RUN --mount=source=nfpm.yml,target=nfpm.yml \
@ -74,7 +84,13 @@ RUN --mount=source=nfpm.yml,target=nfpm.yml \
if [ "$MODE" != "download" ]; then
BUILDX_VERSION="$(git -C "/src" describe --match 'v[0-9]*' --dirty='.m' --always --tags)"
fi
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info os)/$(xx-info arch)"
PKG_OUTPUT="${PKG_OUTPUT}/${PKG_DISTRO}"
if [ "${PKG_DISTRO}" = "static" ]; then
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info os)"
else
PKG_OUTPUT="${PKG_OUTPUT}/${PKG_SUITE}"
fi
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info arch)"
if [ -n "$(xx-info variant)" ]; then
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info variant)"
fi
@ -112,7 +128,7 @@ RUN --mount=source=nfpm.yml,target=nfpm.yml \
esac
(
set -x
ARCH="${arch}" VERSION="${BUILDX_VERSION}" RELEASE="$PKG_RELEASE" VENDOR="${PKG_VENDOR}" PACKAGER="${PKG_PACKAGER}" nfpm package --config ./nfpm.yml --packager $PKG_TYPE --target "$PKG_OUTPUT"
ARCH="${arch}" VERSION="${BUILDX_VERSION}" RELEASE="$PKG_REVISION" VENDOR="${PKG_VENDOR}" PACKAGER="${PKG_PACKAGER}" nfpm package --config ./nfpm.yml --packager $PKG_TYPE --target "$PKG_OUTPUT"
)
else
rm -rf "${PKG_OUTPUT}"
@ -130,17 +146,35 @@ ARG TARGETARCH
ARG TARGETVARIANT
RUN --mount=from=bin-folder,source=.,target=/release <<EOT
set -e
basedir="${TARGETOS}/${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
for f in /release/*; do
[ ! -d "${f}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/${basedir}"
cp "${f}/${basedir}"/* "/out/${basedir}/"
)
pkgtype=$(basename $f)
if [ "$pkgtype" = "static" ]; then
basedir="${TARGETOS}/${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
[ ! -d "${f}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/static/${basedir}"
cp "${f}/${basedir}"/* "/out/static/${basedir}/"
)
else
[ "${TARGETOS}" != "linux" ] && continue
for ff in ${f}/*; do
pkgrelease=$(basename $ff)
basedir="${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
[ ! -d "${ff}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/${pkgtype}/${pkgrelease}/${basedir}"
cp "${ff}/${basedir}"/* "/out/${pkgtype}/${pkgrelease}/${basedir}/"
)
done
fi
done
EOT

Просмотреть файл

@ -13,49 +13,48 @@
# limitations under the License.
include ../../vars.mk
include ../../packages.mk
DESTDIR ?= $(BASEDIR)/bin/local
BAKE_TARGET ?= pkg
word-hypen = $(word $2,$(subst -, ,$1))
DESTDIR ?= $(BASEDIR)/bin
BAKE_DEFINITIONS ?= -f docker-bake.hcl -f ../../packages.hcl
$(info $$BASEDIR = $(BASEDIR))
$(info $$BUILDX_REPO = $(BUILDX_REPO))
$(info $$BUILDX_VERSION = $(BUILDX_VERSION))
.PHONY: all
all: pkg-cross
.PHONY: pkg
pkg: pkg-apk pkg-deb pkg-rpm pkg-static
.PHONY: pkg-apk
pkg-apk:
$(MAKE) $(foreach release,$(PKG_APK_RELEASES),build-cross-apk-$(release))
.PHONY: pkg-%
pkg-%: pkg-%-releases pkg-releases
$(MAKE) $(foreach release,$(PKG_RELEASES),build-$(release))
.PHONY: pkg-apk
pkg-deb:
$(MAKE) $(foreach release,$(PKG_DEB_RELEASES),build-cross-deb-$(release))
.PHONY: pkg-rpm
pkg-rpm:
$(MAKE) $(foreach release,$(PKG_RPM_RELEASES),build-cross-rpm-$(release))
.PHONY: static
.PHONY: pkg-static
pkg-static:
$(MAKE) build-static
.PHONY: pkg-cross
pkg-cross: pkg-cross-apk pkg-cross-deb pkg-cross-rpm pkg-cross-static
.PHONY: pkg-%
pkg-cross-%: pkg-%-releases pkg-releases
$(MAKE) $(foreach release,$(PKG_RELEASES),build-cross-$(release))
.PHONY: pkg-cross-static
pkg-cross-static:
$(MAKE) build-cross-static
.PHONY: build-%
build-%:
$(eval pkg_type=$(call word-hypen,$*,1))
$(eval pkg_release=$(call word-hypen,$*,2))
PKG_TYPE=$(pkg_type) PKG_RELEASE=$(pkg_release) DESTDIR=$(DESTDIR) docker buildx bake $(BAKE_TARGET)
build-%: pkg-info-% pkg-info
PKG_RELEASE=$* DESTDIR=$(DESTDIR) docker buildx bake $(BAKE_DEFINITIONS) pkg
.PHONY: build-cross-%
build-cross-%:
$(eval pkg_type=$(call word-hypen,$*,1))
$(eval pkg_release=$(call word-hypen,$*,2))
$(eval target=build-$(pkg_type)-$(pkg_release))
build-cross-%: pkg-info-% pkg-info
$(eval $@_TMP_OUT := $(shell mktemp -d -t docker-packaging.XXXXXXXXXX))
$(MAKE) $(target:%-=%) DESTDIR=$($@_TMP_OUT) BAKE_TARGET=pkg-cross
$(eval DESTDIR = $(BASEDIR)/bin/$(pkg_type))
PKG_RELEASE=$* DESTDIR=$($@_TMP_OUT) docker buildx bake $(BAKE_DEFINITIONS) pkg-cross
mkdir -p $(DESTDIR)
find $($@_TMP_OUT) -mindepth 2 -maxdepth 2 -type d -exec cp -rf {} $(DESTDIR)/ ';'
find $(DESTDIR) -type d -empty -delete

Просмотреть файл

@ -30,17 +30,15 @@ variable "PKG_NAME" {
default = "docker-buildx-plugin"
}
# Sets the list of package types to build: apk, deb, rpm or static
variable "PKG_TYPE" {
# Sets release flavor. See packages.hcl and packages.mk for more details.
variable "PKG_RELEASE" {
default = "static"
}
# Sets release name for apk, deb and rpm package types (e.g., r0)
# apk: r0 => docker-buildx-plugin_0.8.1-r0_aarch64.apk
# deb: debian11 => docker-buildx-plugin_0.8.1-debian11_arm64.deb
# rpm: fedora36 => docker-buildx-plugin-0.8.1-fedora36.aarch64.rpm
variable "PKG_RELEASE" {
default = "unknown"
target "_pkg-static" {
args = {
PKG_RELEASE = ""
PKG_TYPE = "static"
}
}
# Sets the vendor/maintainer name (only for linux packages)
@ -53,6 +51,12 @@ variable "PKG_PACKAGER" {
default = "Docker <support@docker.com>"
}
# Include an extra `.0` in the version, in case we ever would have to re-build
# an already published release with a packaging-only change.
variable "PKG_REVISION" {
default = "0"
}
# Defines the output folder
variable "DESTDIR" {
default = ""
@ -72,14 +76,14 @@ group "default" {
}
target "_common" {
inherits = ["_pkg-${PKG_RELEASE}"]
args = {
BUILDX_REPO = BUILDX_REPO
BUILDX_VERSION = BUILDX_VERSION
PKG_NAME = PKG_NAME
PKG_TYPE = PKG_TYPE
PKG_RELEASE = PKG_RELEASE
PKG_VENDOR = PKG_VENDOR
PKG_PACKAGER = PKG_PACKAGER
PKG_REVISION = PKG_REVISION
}
}
@ -99,8 +103,8 @@ target "_platforms" {
]
}
# $ PKG_TYPE=deb PKG_DEB_RELEASE=debian11 docker buildx bake pkg
# $ docker buildx bake --set *.platform=windows/amd64 --set *.output=./bin pkg
# $ PKG_RELEASE=debian11 docker buildx bake pkg
# $ docker buildx bake --set *.platform=linux/amd64 --set *.output=./bin pkg
group "pkg" {
targets = [substr(BUILDX_VERSION, 0, 1) == "#" ? "_pkg-build" : "_pkg-download"]
}
@ -112,8 +116,8 @@ group "pkg-cross" {
# Create release image by using ./bin folder as named context. Therefore
# pkg-cross target must be run before using this target:
# $ PKG_TYPE=deb PKG_DEB_RELEASE=debian11 docker buildx bake pkg-cross
# $ docker buildx bake release --set *.output=type=image,push=true --set *.tags=docker/packaging:buildx-0.8.1-r0
# $ PKG_RELEASE=debian11 docker buildx bake pkg-cross
# $ docker buildx bake release --push --set *.tags=docker/packaging:build-v0.9.1
target "release" {
inherits = ["meta-helper", "_platforms"]
target = "release"

Просмотреть файл

@ -19,6 +19,13 @@ ARG NFPM_VERSION="2.15.1"
ARG XX_VERSION="1.1.2"
ARG MODE="download"
# pkg matrix
ARG PKG_RELEASE="debian11"
ARG PKG_TYPE="deb"
ARG PKG_DISTRO="debian"
ARG PKG_SUITE="bullseye"
ARG PKG_BASE_IMAGE="debian:bullseye"
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS base
RUN apk add --no-cache bash curl file git zip tar
@ -63,10 +70,13 @@ COPY --from=binary /out/compose /usr/bin/compose
ARG MODE
ARG COMPOSE_VERSION
ARG PKG_NAME
ARG PKG_TYPE
ARG PKG_RELEASE
ARG PKG_VENDOR
ARG PKG_TYPE
ARG PKG_DISTRO
ARG PKG_SUITE
ARG PKG_PACKAGER
ARG PKG_VENDOR
ARG PKG_REVISION
ARG PKG_OUTPUT=/build
ARG TARGETPLATFORM
RUN --mount=source=nfpm.yml,target=nfpm.yml \
@ -76,7 +86,13 @@ RUN --mount=source=nfpm.yml,target=nfpm.yml \
if [ "$MODE" != "download" ]; then
COMPOSE_VERSION="$(git -C "/src" describe --match 'v[0-9]*' --dirty='.m' --always --tags)"
fi
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info os)/$(xx-info arch)"
PKG_OUTPUT="${PKG_OUTPUT}/${PKG_DISTRO}"
if [ "${PKG_DISTRO}" = "static" ]; then
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info os)"
else
PKG_OUTPUT="${PKG_OUTPUT}/${PKG_SUITE}"
fi
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info arch)"
if [ -n "$(xx-info variant)" ]; then
PKG_OUTPUT="${PKG_OUTPUT}/$(xx-info variant)"
fi
@ -114,7 +130,7 @@ RUN --mount=source=nfpm.yml,target=nfpm.yml \
esac
(
set -x
ARCH="${arch}" VERSION="${COMPOSE_VERSION}" RELEASE="$PKG_RELEASE" VENDOR="${PKG_VENDOR}" PACKAGER="${PKG_PACKAGER}" nfpm package --config ./nfpm.yml --packager $PKG_TYPE --target "$PKG_OUTPUT"
ARCH="${arch}" VERSION="${COMPOSE_VERSION}" RELEASE="$PKG_REVISION" VENDOR="${PKG_VENDOR}" PACKAGER="${PKG_PACKAGER}" nfpm package --config ./nfpm.yml --packager $PKG_TYPE --target "$PKG_OUTPUT"
)
else
rm -rf "${PKG_OUTPUT}"
@ -132,17 +148,35 @@ ARG TARGETARCH
ARG TARGETVARIANT
RUN --mount=from=bin-folder,source=.,target=/release <<EOT
set -e
basedir="${TARGETOS}/${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
for f in /release/*; do
[ ! -d "${f}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/${basedir}"
cp "${f}/${basedir}"/* "/out/${basedir}/"
)
pkgtype=$(basename $f)
if [ "$pkgtype" = "static" ]; then
basedir="${TARGETOS}/${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
[ ! -d "${f}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/static/${basedir}"
cp "${f}/${basedir}"/* "/out/static/${basedir}/"
)
else
[ "${TARGETOS}" != "linux" ] && continue
for ff in ${f}/*; do
pkgrelease=$(basename $ff)
basedir="${TARGETARCH}"
if [ -n "$TARGETVARIANT" ]; then
basedir="${basedir}/${TARGETVARIANT}"
fi
[ ! -d "${ff}/${basedir}" ] && continue
(
set -x
mkdir -p "/out/${pkgtype}/${pkgrelease}/${basedir}"
cp "${ff}/${basedir}"/* "/out/${pkgtype}/${pkgrelease}/${basedir}/"
)
done
fi
done
EOT

Просмотреть файл

@ -13,49 +13,48 @@
# limitations under the License.
include ../../vars.mk
include ../../packages.mk
DESTDIR ?= $(BASEDIR)/bin/local
BAKE_TARGET ?= pkg
word-hypen = $(word $2,$(subst -, ,$1))
DESTDIR ?= $(BASEDIR)/bin
BAKE_DEFINITIONS ?= -f docker-bake.hcl -f ../../packages.hcl
$(info $$BASEDIR = $(BASEDIR))
$(info $$COMPOSE_REPO = $(COMPOSE_REPO))
$(info $$COMPOSE_VERSION = $(COMPOSE_VERSION))
.PHONY: all
all: pkg-cross
.PHONY: pkg
pkg: pkg-apk pkg-deb pkg-rpm pkg-static
.PHONY: pkg-apk
pkg-apk:
$(MAKE) $(foreach release,$(PKG_APK_RELEASES),build-cross-apk-$(release))
.PHONY: pkg-%
pkg-%: pkg-%-releases pkg-releases
$(MAKE) $(foreach release,$(PKG_RELEASES),build-$(release))
.PHONY: pkg-apk
pkg-deb:
$(MAKE) $(foreach release,$(PKG_DEB_RELEASES),build-cross-deb-$(release))
.PHONY: pkg-rpm
pkg-rpm:
$(MAKE) $(foreach release,$(PKG_RPM_RELEASES),build-cross-rpm-$(release))
.PHONY: static
.PHONY: pkg-static
pkg-static:
$(MAKE) build-static
.PHONY: pkg-cross
pkg-cross: pkg-cross-apk pkg-cross-deb pkg-cross-rpm pkg-cross-static
.PHONY: pkg-%
pkg-cross-%: pkg-%-releases pkg-releases
$(MAKE) $(foreach release,$(PKG_RELEASES),build-cross-$(release))
.PHONY: pkg-cross-static
pkg-cross-static:
$(MAKE) build-cross-static
.PHONY: build-%
build-%:
$(eval pkg_type=$(call word-hypen,$*,1))
$(eval pkg_release=$(call word-hypen,$*,2))
PKG_TYPE=$(pkg_type) PKG_RELEASE=$(pkg_release) DESTDIR=$(DESTDIR) docker buildx bake $(BAKE_TARGET)
build-%: pkg-info-% pkg-info
PKG_RELEASE=$* DESTDIR=$(DESTDIR) docker buildx bake $(BAKE_DEFINITIONS) pkg
.PHONY: build-cross-%
build-cross-%:
$(eval pkg_type=$(call word-hypen,$*,1))
$(eval pkg_release=$(call word-hypen,$*,2))
$(eval target=build-$(pkg_type)-$(pkg_release))
build-cross-%: pkg-info-% pkg-info
$(eval $@_TMP_OUT := $(shell mktemp -d -t docker-packaging.XXXXXXXXXX))
$(MAKE) $(target:%-=%) DESTDIR=$($@_TMP_OUT) BAKE_TARGET=pkg-cross
$(eval DESTDIR = $(BASEDIR)/bin/$(pkg_type))
PKG_RELEASE=$* DESTDIR=$($@_TMP_OUT) docker buildx bake $(BAKE_DEFINITIONS) pkg-cross
mkdir -p $(DESTDIR)
find $($@_TMP_OUT) -mindepth 2 -maxdepth 2 -type d -exec cp -rf {} $(DESTDIR)/ ';'
find $(DESTDIR) -type d -empty -delete

Просмотреть файл

@ -19,7 +19,7 @@ variable "COMPOSE_REPO" {
default = "https://github.com/docker/compose.git"
}
# Sets the buildx version to download the binary from GitHub Releases.
# Sets the compose version to download the binary from GitHub Releases.
# If version starts with # it will build from source.
variable "COMPOSE_VERSION" {
default = "v2.10.2"
@ -30,17 +30,15 @@ variable "PKG_NAME" {
default = "docker-compose-plugin"
}
# Sets the list of package types to build: apk, deb, rpm or static
variable "PKG_TYPE" {
# Sets release flavor. See packages.hcl and packages.mk for more details.
variable "PKG_RELEASE" {
default = "static"
}
# Sets release name for apk, deb and rpm package types (e.g., r0)
# apk: r0 => docker-compose-plugin_2.10.2-r0_aarch64.apk
# deb: debian11 => docker-compose-plugin_2.10.2-debian11_arm64.deb
# rpm: fedora36 => docker-compose-plugin-2.10.2-fedora36.aarch64.rpm
variable "PKG_RELEASE" {
default = "unknown"
target "_pkg-static" {
args = {
PKG_RELEASE = ""
PKG_TYPE = "static"
}
}
# Sets the vendor/maintainer name (only for linux packages)
@ -53,6 +51,12 @@ variable "PKG_PACKAGER" {
default = "Docker <support@docker.com>"
}
# Include an extra `.0` in the version, in case we ever would have to re-build
# an already published release with a packaging-only change.
variable "PKG_REVISION" {
default = "0"
}
# Defines the output folder
variable "DESTDIR" {
default = ""
@ -72,14 +76,14 @@ group "default" {
}
target "_common" {
inherits = ["_pkg-${PKG_RELEASE}"]
args = {
COMPOSE_REPO = COMPOSE_REPO
COMPOSE_VERSION = COMPOSE_VERSION
PKG_NAME = PKG_NAME
PKG_TYPE = PKG_TYPE
PKG_RELEASE = PKG_RELEASE
PKG_VENDOR = PKG_VENDOR
PKG_PACKAGER = PKG_PACKAGER
PKG_REVISION = PKG_REVISION
}
}
@ -99,8 +103,8 @@ target "_platforms" {
]
}
# $ PKG_TYPE=deb PKG_DEB_RELEASE=debian11 docker buildx bake pkg
# $ docker buildx bake --set *.platform=windows/amd64 --set *.output=./bin pkg
# $ PKG_RELEASE=debian11 docker buildx bake pkg
# $ docker buildx bake --set *.platform=linux/amd64 --set *.output=./bin pkg
group "pkg" {
targets = [substr(COMPOSE_VERSION, 0, 1) == "#" ? "_pkg-build" : "_pkg-download"]
}
@ -112,8 +116,8 @@ group "pkg-cross" {
# Create release image by using ./bin folder as named context. Therefore
# pkg-cross target must be run before using this target:
# $ PKG_TYPE=deb PKG_DEB_RELEASE=debian11 docker buildx bake pkg-cross
# $ docker buildx bake release --set *.output=type=image,push=true --set *.tags=docker/packaging:compose-2.10.2-r0
# $ PKG_RELEASE=debian11 docker buildx bake pkg-cross
# $ docker buildx bake release --push --set *.tags=docker/packaging:compose-v2.10.2
target "release" {
inherits = ["meta-helper", "_platforms"]
target = "release"

Просмотреть файл

@ -12,10 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
PKG_APK_RELEASES ?= r0
PKG_DEB_RELEASES ?= debian10 debian11 ubuntu1804 ubuntu2004 ubuntu2204 raspbian10 raspbian11
PKG_RPM_RELEASES ?= centos7 centos8 fedora33 fedora34 fedora35 fedora36
export BASEDIR ?= $(CURDIR)
export PKG_VENDOR ?= Docker
export PKG_PACKAGER ?= Docker <support@docker.com>
@ -26,8 +22,10 @@ export COMPOSE_REPO ?= https://github.com/docker/compose.git
export BUILDX_VERSION ?= v0.9.1
export COMPOSE_VERSION ?= v2.10.2
.PHONY: buildx-version
buildx-version:
@echo $(BUILDX_VERSION)
.PHONY: compose-version
compose-version:
@echo $(COMPOSE_VERSION)