Skip to content

Commit

Permalink
fork, update, and expand; release v0.0.0
Browse files Browse the repository at this point in the history
This project now attempts to build the following docker CPU
architectures for Debian `sid`:

  alpha, amd64, arm32v5, arm32v7, arm64v8, hppa, i386, loong64, m68k, mips64le,
  ppc, ppc64, ppc64le, riscv64, s390x, sh4, sparc64

- Update to qemu-v9.0.2-2; enable new CPU arches
- Update to `qemu-v9.0.2-2` from `polyarch/qemu-user-static`
- Build docker images using `ubuntu-24.04`
- Use `qemu-user-static` and `binfmt-support` from Ubuntu Noble to test images
- Show /proc/sys/fs/binfmt_misc/* during building and testing
- Publish v0.0.0 to:
    https://hub.docker.com/repository/docker/polyarch/debian-ports/
  • Loading branch information
ioerror committed Oct 21, 2024
1 parent e7c448f commit a1447e3
Show file tree
Hide file tree
Showing 3 changed files with 292 additions and 66 deletions.
218 changes: 201 additions & 17 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,221 @@ on:
paths:
- 'update.sh'
- '.github/workflows/actions.yml'
schedule:
- cron: '0 0 15 * *'
workflow_dispatch:

env:
DEBIAN_FRONTEND: 'noninteractive'
BOOTSTRAP_VERSION: 'v0.0.0'
DOCKER_REPO: 'polyarch/debian-ports'
DOCKER_REG: 'docker.io/'
QEMU_VER: 'v9.0.2-2'
OS: 'linux'
PORTS_SUITE: 'sid'
SUPPORTED_SUITE: 'sid'
HOST_PACKAGES: 'qemu-user-static debootstrap'

jobs:
debian-debootstrap-ports:
runs-on: ubuntu-latest
build-ports:
runs-on: ubuntu-24.04
env:
MIRROR: 'https://deb.debian.org/debian-ports/'
strategy:
fail-fast: false
matrix:
QEMU_VER: [v7.2.0-1]
DOCKER_REPO: [docker.io/urbanogilson/debian-debootstrap-ports]
VERSION: [sid]
UNAME_ARCH: [alpha, hppa, m68k, powerpc, ppc64, sh4]
CONTAINER_ARCH: [alpha, hppa, loong64, m68k, ppc, ppc64, sh4, sparc64]
include:
- {ARCH: alpha, QEMU_ARCH: alpha, UNAME_ARCH: alpha}
- {ARCH: hppa, QEMU_ARCH: hppa, UNAME_ARCH: hppa}
- {ARCH: m68k, QEMU_ARCH: m68k, UNAME_ARCH: m68k}
- {ARCH: powerpc, QEMU_ARCH: ppc, UNAME_ARCH: powerpc}
- {ARCH: ppc64, QEMU_ARCH: ppc64, UNAME_ARCH: ppc64}
- {ARCH: sh4, QEMU_ARCH: sh4, UNAME_ARCH: sh4}
- {ARCH: alpha, QEMU_ARCH: alpha, UNAME_ARCH: alpha, CONTAINER_ARCH: alpha}
- {ARCH: hppa, QEMU_ARCH: hppa, UNAME_ARCH: hppa, CONTAINER_ARCH: hppa}
- {ARCH: loong64, QEMU_ARCH: loongarch64, UNAME_ARCH: loong64, CONTAINER_ARCH: loong64}
- {ARCH: m68k, QEMU_ARCH: m68k, UNAME_ARCH: m68k, CONTAINER_ARCH: m68k}
- {ARCH: powerpc, QEMU_ARCH: ppc, UNAME_ARCH: ppc, CONTAINER_ARCH: ppc}
- {ARCH: ppc64, QEMU_ARCH: ppc64, UNAME_ARCH: ppc64, CONTAINER_ARCH: ppc64}
- {ARCH: sh4, QEMU_ARCH: sh4, UNAME_ARCH: sh4, CONTAINER_ARCH: sh4}
- {ARCH: sparc64, QEMU_ARCH: sparc64, UNAME_ARCH: sparc64, CONTAINER_ARCH: sparc64}
steps:
- uses: actions/checkout@v4
- name: Build
run: |
sudo apt update && sudo apt install -y qemu-user-static debootstrap
./update.sh -a ${{ matrix.ARCH }} -v ${{ matrix.VERSION }} -q ${{ matrix.QEMU_ARCH }} -u ${{ matrix.QEMU_VER }} -d ${{ matrix.DOCKER_REPO }} -o ${{ matrix.UNAME_ARCH }}
sudo rm /var/lib/man-db/auto-update;
echo "man-db man-db/auto-update boolean false" | sudo debconf-set-selections;
sudo apt purge -y needrestart snapd firefox;
sudo apt-mark hold snapd;
sudo apt update;
sudo bash -c "apt install -y $HOST_PACKAGES || true";
dpkg -L qemu-user-static | grep ${{ matrix.QEMU_ARCH }};
ls -alh /proc/sys/fs/binfmt_misc/*;
./update.sh \
-a ${{ matrix.ARCH }} \
-q ${{ matrix.QEMU_ARCH }} \
-o ${{ matrix.UNAME_ARCH }} \
-c ${{ matrix.CONTAINER_ARCH }} \
-u ${QEMU_VER} \
-d ${DOCKER_REPO} \
-v ${BOOTSTRAP_VERSION} \
-s ${PORTS_SUITE} \
-z ${OS} \
-m ${MIRROR};
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker images
if: github.ref == 'refs/heads/main'
run: |
docker push -a ${DOCKER_REPO}
build-supported:
runs-on: ubuntu-24.04
env:
MIRROR: 'https://deb.debian.org/debian/'
strategy:
fail-fast: false
matrix:
CONTAINER_ARCH: [amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, riscv64, s390x]
include:
- {ARCH: amd64, QEMU_ARCH: x86_64, UNAME_ARCH: x86_64, CONTAINER_ARCH: amd64}
- {ARCH: armel, QEMU_ARCH: arm, UNAME_ARCH: armv7l, CONTAINER_ARCH: arm32v5}
- {ARCH: armhf, QEMU_ARCH: arm, UNAME_ARCH: armv7l, CONTAINER_ARCH: arm32v7}
- {ARCH: arm64, QEMU_ARCH: aarch64, UNAME_ARCH: aarch64, CONTAINER_ARCH: arm64v8}
- {ARCH: i386, QEMU_ARCH: i386, UNAME_ARCH: i386, CONTAINER_ARCH: i386}
- {ARCH: mips64el, QEMU_ARCH: mips64el, UNAME_ARCH: mips64, CONTAINER_ARCH: mips64le}
- {ARCH: ppc64el, QEMU_ARCH: ppc64le, UNAME_ARCH: ppc64le, CONTAINER_ARCH: ppc64le}
- {ARCH: riscv64, QEMU_ARCH: riscv64, UNAME_ARCH: riscv64, CONTAINER_ARCH: riscv64}
- {ARCH: s390x, QEMU_ARCH: s390x, UNAME_ARCH: s390x, CONTAINER_ARCH: s390x}
steps:
- uses: actions/checkout@v4
- name: Build
run: |
sudo rm /var/lib/man-db/auto-update;
echo "man-db man-db/auto-update boolean false" | sudo debconf-set-selections;
sudo apt purge -y needrestart snapd firefox;
sudo apt-mark hold snapd;
sudo apt update;
sudo bash -c "apt install -y $HOST_PACKAGES || true";
dpkg -L qemu-user-static | grep ${{ matrix.QEMU_ARCH }};
ls -alh /proc/sys/fs/binfmt_misc/*;
./update.sh \
-a ${{ matrix.ARCH }} \
-q ${{ matrix.QEMU_ARCH }} \
-o ${{ matrix.UNAME_ARCH }} \
-c ${{ matrix.CONTAINER_ARCH }} \
-u ${QEMU_VER} \
-d ${DOCKER_REPO} \
-v ${BOOTSTRAP_VERSION} \
-s ${SUPPORTED_SUITE} \
-z ${OS} \
-m ${MIRROR};
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker images
if: github.ref == 'refs/heads/main'
run: |
docker push -a ${DOCKER_REPO}
docker-combine:
needs: [build-supported, build-ports]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Combine into One Big Union for this version
run: |
docker manifest create ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION} \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-alpha \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-amd64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-arm32v5 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-arm32v7 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-arm64v8 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-hppa \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-i386 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-loong64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-m68k \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-mips64le \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-ppc \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-ppc64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-ppc64le \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-riscv64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-s390x \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-sh4 \
--amend ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}-${OS}-sparc64
- name: Inspect the combination for this version
run: |
docker manifest inspect -v ${DOCKER_REPO}:${BOOTSTRAP_VERSION}
- name: Combine into One Big Union for latest
run: |
docker manifest create ${DOCKER_REG}${DOCKER_REPO}:latest \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-alpha \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-amd64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-arm32v5 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-arm32v7 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-arm64v8 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-hppa \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-i386 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-loong64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-m68k \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-mips64le \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-ppc \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-ppc64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-ppc64le \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-riscv64 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-s390x \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-sh4 \
--amend ${DOCKER_REG}${DOCKER_REPO}:latest-${OS}-sparc64
- name: Inspect the combination for latest
run: |
docker manifest inspect -v ${DOCKER_REPO}:latest
- name: Publish Docker polyarch manifest for this version
if: github.ref == 'refs/heads/main'
run: |
docker manifest push ${DOCKER_REG}${DOCKER_REPO}:${BOOTSTRAP_VERSION}
- name: Publish Docker polyarch manifest for latest
if: github.ref == 'refs/heads/main'
run: |
docker manifest push ${DOCKER_REG}${DOCKER_REPO}:latest
docker-uname:
needs: [docker-combine]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
QEMU_ARCH: [alpha, amd64, arm32v5, arm32v7, arm64v8, hppa, i386,
loong64, m68k, mips64le, ppc, ppc64, ppc64le, riscv64,
s390x, sh4, sparc64]
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: uname
run: |
docker push -a ${{ matrix.DOCKER_REPO }}
sudo rm /var/lib/man-db/auto-update;
echo "man-db man-db/auto-update boolean false" | sudo debconf-set-selections;
sudo apt purge -y needrestart snapd firefox;
sudo apt-mark hold snapd;
sudo apt update;
ls -alh /proc/sys/fs/binfmt_misc/*;
sudo apt install -y wget;
wget -c http://de.archive.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-user-static_9.0.2+ds-4ubuntu5_amd64.deb
wget -c http://de.archive.ubuntu.com/ubuntu/pool/universe/b/binfmt-support/binfmt-support_2.2.2-7_amd64.deb
sudo dpkg -i binfmt-support_*_amd64.deb
sudo dpkg -i qemu-user-static*_amd64.deb
ls -alh /proc/sys/fs/binfmt_misc/*;
docker run --platform linux/${{ matrix.QEMU_ARCH }} --rm -t \
polyarch/debian-ports:latest uname -a
62 changes: 40 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,64 @@
# debian-debootstrap-ports
# debian-ports

[![actions](https://github.com/urbanogilson/debian-debootstrap-ports/actions/workflows/actions.yml/badge.svg?branch=main)](https://github.com/urbanogilson/debian-debootstrap-ports/actions/workflows/actions.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/urbanogilson/debian-debootstrap-ports)](https://hub.docker.com/r/urbanogilson/debian-debootstrap-ports)
[![CI](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/urbanogilson/debian-debootstrap-ports/blob/main/LICENSE)
[![actions](https://github.com/ioerror/debian-debootstrap-ports/actions/workflows/actions.yml/badge.svg?branch=main)](https://github.com/ioerror/debian-debootstrap-ports/actions/workflows/actions.yml)
[![Docker Pulls](https://img.shields.io/docker/pulls/polyarch/debian-debootstrap-ports)](https://hub.docker.com/r/polyarch/debian-debootstrap-ports)
[![CI](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/ioerror/debian-debootstrap-ports/blob/main/LICENSE)

`debian-debootstrap-ports` Docker image for multiple architectures (ports)
`polyarch/debian-ports` Docker images of Debian GNU/Linux `sid`

## Usage

Before using this Docker image, you need to configure binfmt-support on your Docker host. This works both locally and remotely (e.g., using boot2docker or swarm).

If your Operating System provides a modern `qemu-user-static` package and the
`binfmt-support` package then it should be sufficient to use those packages.
For example configure the docker host on Ubuntu Noble (24.10) by installing the
following packages:
```console
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ apt install qemu-user-static binfmt-support
```

Once configured, you can run a `powerpc` image from your `x86_64` Docker host.
Alternatively, before using any of these Docker images, you need to configure binfmt
support on your Docker host. This works both locally and remotely (e.g., using
`boot2docker` or `swarm`).

```console
$ docker run --rm --privileged polyarch/qemu-user-static --reset -p yes
```

Once configured, you can run an image from your Docker host by selected a CPU
architecture and setting it as part of the platform string:
```console
$ $ docker run -it --rm urbanogilson/debian-debootstrap-ports:powerpc-trixie-sid
root@12c7a97fd7d8:/# uname -a
Linux 12c7a97fd7d8 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 ppc GNU/Linux
root@12c7a97fd7d8:/#
$ docker run --platform linux/loong64 -it --rm polyarch/debian-ports uname -m
loongarch64
```

## Supported ports

Port | Architecture | Description
| ------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
alpha | Alpha | Port to the 64-bit RISC Alpha architecture. |
hppa | HP PA-RISC | Port to Hewlett-Packard's PA-RISC architecture. |
m68k | Motorola 68k | Port to the Motorola 68k series of processors — in particular, the Sun3 range of workstations, the Apple Macintosh personal computers, and the Atari and Amiga personal computers. |
powerpc/ppc64 | Motorola/IBM PowerPC | Port for many of the Apple Macintosh PowerMac models, and CHRP and PReP open architecture machines. |
sh4 | SuperH | Port to Hitachi SuperH processors. Also supports the open source J-Core processor. |
```
ARCH_LIST="alpha amd64 arm32v5 arm32v7 arm64v8 hppa i386 \
loong64 m68k mips64le ppc ppc64 ppc64le riscv64 \
s390x sh4 sparc64"
for ARCH in $ARCH_LIST;
do
docker run --platform linux/${ARCH} --rm -t \
polyarch/debian-ports:latest uname -a
done
```

## Source of Images

The images provided in this repository are sourced from [Debian other ports](https://www.debian.org/ports/#portlist-other).
All images are generated from the respective architecture specific Debian
GNU/Linux Operating System package repositories. Docker images are generated
with the included `update.sh` script and the GitHub Action that runs it.

## Notes

Only `x86_64` has been tested as a host architecture.

## Original Project

This project is based on [multiarch/debian-debootstrap](https://github.com/multiarch/debian-debootstrap), which supports a wide range of other architectures.
This project was forked from [urbanogilson/debian-debootstrap-ports](https://github.com/urbanogilson/debian-debootstrap-ports).

## License

This project is licensed under the [MIT License](LICENSE).
This project is licensed under the [MIT License](LICENSE).
Loading

0 comments on commit a1447e3

Please sign in to comment.