From a1447e322f2e33897bbd2d96530c9ea70d081263 Mon Sep 17 00:00:00 2001 From: Jacob Appelbaum Date: Fri, 11 Oct 2024 13:42:24 +0200 Subject: [PATCH] fork, update, and expand; release v0.0.0 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/ --- .github/workflows/actions.yml | 218 +++++++++++++++++++++++++++++++--- README.md | 62 ++++++---- update.sh | 78 +++++++----- 3 files changed, 292 insertions(+), 66 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 55b85b4..4c673e3 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -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 }} \ No newline at end of file + 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 diff --git a/README.md b/README.md index 37b6bb7..1649b9b 100644 --- a/README.md +++ b/README.md @@ -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). \ No newline at end of file +This project is licensed under the [MIT License](LICENSE). diff --git a/update.sh b/update.sh index fd8d4aa..c6f2505 100755 --- a/update.sh +++ b/update.sh @@ -1,14 +1,18 @@ #!/bin/bash +set -x set -eo pipefail + # A POSIX variable OPTIND=1 # Reset in case getopts has been used previously in the shell. -while getopts "a:v:q:u:d:s:i:o:" opt; do +while getopts "a:c:s:q:u:d:o:m:v:z:" opt; do case "$opt" in a) ARCH=$OPTARG ;; - v) VERSION=$OPTARG + c) CONTAINER_ARCH=$OPTARG + ;; + s) SUITE=$OPTARG ;; q) QEMU_ARCH=$OPTARG ;; @@ -18,6 +22,12 @@ while getopts "a:v:q:u:d:s:i:o:" opt; do ;; o) UNAME_ARCH=$OPTARG ;; + m) MIRROR=$OPTARG + ;; + v) BOOTSTRAP_VERSION=$OPTARG + ;; + z) OS=$OPTARG + ;; esac done @@ -25,11 +35,30 @@ shift $((OPTIND-1)) [ "$1" = "--" ] && shift -dir="$VERSION-$ARCH" +CONTAINER_PLATFORM="${OS}/${CONTAINER_ARCH}" +echo "update.sh: $BOOTSTRAP_VERSION" +echo "ARCH=$ARCH" +echo "Building Debian $UNAME_ARCH/$SUITE for Docker $DOCKER_REPO on $CONTAINER_PLATFORM" +echo "qemu-$QEMU_VER emulating $QEMU_ARCH" +echo "Debian mirror: $MIRROR" +echo "Environment follows:" +echo "`env`" +echo "BEGIN" + +EXTRA_PACKAGES="apt-transport-https autoconf bash build-essential ca-certificates curl debian-ports-archive-keyring git libcap2-bin libnetfilter-queue-dev libnfnetlink-dev libsodium-dev libssl-dev lsb-release nftables python3 python3-build python3-dev python3-venv python3-virtualenv sudo joe wget" +# Try a very minimal setup, just enough to install packages later +EXTRA_PACKAGES="apt-transport-https bash ca-certificates debian-archive-keyring debian-ports-archive-keyring git lsb-release wget" + +dir="$SUITE-$ARCH" VARIANT="minbase" -args=( -d "$dir" debootstrap --no-check-gpg --variant="$VARIANT" --include="wget" --arch="$ARCH" "$VERSION" https://deb.debian.org/debian-ports) +args=( -d "$dir" debootstrap --verbose --no-check-gpg --variant="$VARIANT" --include="$EXTRA_PACKAGES" --arch="$ARCH" "$SUITE" "$MIRROR") mkdir -p mkimage $dir +# if [ $ARCH = 'sparc64' ]; then +# echo 'disabling priv dropping for sparc64 due to upstream issues'; +# mkdir -p $dir/rootfs/etc/apt/apt.conf.d/; +# echo -n 'APT::Sandbox::User "root";' > $dir/rootfs/etc/apt/apt.conf.d/000-no-user-switch; +# fi curl https://raw.githubusercontent.com/moby/moby/6f78b438b88511732ba4ac7c7c9097d148ae3568/contrib/mkimage.sh > mkimage.sh curl https://raw.githubusercontent.com/moby/moby/6f78b438b88511732ba4ac7c7c9097d148ae3568/contrib/mkimage/debootstrap > mkimage/debootstrap chmod +x mkimage.sh mkimage/debootstrap @@ -47,30 +76,25 @@ sudo chown -R "$(id -u):$(id -g)" "$dir" xz -d < $dir/rootfs.tar.xz | gzip -c > $dir/rootfs.tar.gz sed -i /^ENV/d "${dir}/Dockerfile" -echo "ENV ARCH=${UNAME_ARCH} UBUNTU_SUITE=${VERSION} DOCKER_REPO=${DOCKER_REPO}" >> "${dir}/Dockerfile" +echo "ENV ARCH=${UNAME_ARCH} UBUNTU_SUITE=${SUITE} DOCKER_REPO=${DOCKER_REPO}" >> "${dir}/Dockerfile" if [ "$DOCKER_REPO" ]; then - docker build -t "${DOCKER_REPO}:${ARCH}-${VERSION}-slim" "${dir}" - mkdir -p "${dir}/full" - ( - cd "${dir}/full" - if [ ! -f x86_64_qemu-${QEMU_ARCH}-static.tar.gz ]; then - wget -N https://github.com/multiarch/qemu-user-static/releases/download/${QEMU_VER}/x86_64_qemu-${QEMU_ARCH}-static.tar.gz - fi - tar xf x86_64_qemu-*.gz - ) - cat > "${dir}/full/Dockerfile" < "${dir}/full/Dockerfile" <