Alpine-based image with podman and qemu. Easily allows cross platform image builds.
10K+
Source: https://gitlab.com/agrozyme-docker/podman-qemu
Alpine-based image with podman and qemu. Easily allows cross platform image builds.
Inspired By jonoh/docker-buildx-qemu
It's been tested with GitLab CI on gitlab.com
This Docker image can emulate the environments.
Use valid GOARCH values, see:
The Docker image can run in the environment (The intersection of Alpine and QEMU support platforms):
It has two template files for building multi-platform Docker images.
main to latest/.gitlab/ci/single/docker-hub.yaml/.gitlab/ci/multiple/docker-hub.yaml/.gitlab/ci/single/gitlab.yaml/.gitlab/ci/multiple/gitlab.yamlmain tag of the docker image is used to test the build.build-one-arch job pushes the main tag of the docker image.build-one-arch job is successful, then the other build job pushes the multi-platform Docker image.build-metadata-push job will update the description of the Docker Hub repository.
description of
the project.README.mdPut all docker image repositories into a Group and
set Variables in CI / CD Settings
Put the variables in .gitlab-ci.yml or CI / CD Settings to override default.
.gitlab-ci.yml stage variables.gitlab-ci.yml global variablesCI / CD SettingsCI / CD SettingsNo default value, all variables are required. (Only for Docker Hub)
DOCKER_HUB_USER: Login usernameDOCKER_HUB_PASS: Access token
DOCKER_HUB_NAMESPACE:
Dockerfile as an ARG.DOCKER_HUB_API_URL
.gitlab-ci.yml to overridehttps://hub.docker.com/v2DOCKER_REGISTRY
docker login server.gitlab-ci.yml to overrideDockerfile as an ARG.docker.ioDOCKER_ARCH
amd64.DOCKER_TAG_SUFFIX
DOCKER_ARCHIt has two bash scripts to hook before_script and after_script, the scripts run at beginning and end of the docker
build and push action.
Note:
before_script.sh and
using COPY command in the Dockerfile.podman build and you can speed up the build of multi-platform docker image.It define some tasks, you can combine for your tasks
Build the same architecture image as the CI runner for quick testing of build scripts
Build the DOCKER_ARCH architecture image
Create and push the manifest using DOCKER_ARCH
Update metadata to the docker registry
This GitLab example should give you an idea of how to use the image.
.gitlab-ci.yml
include:
- project: agrozyme-docker/podman-qemu
ref: main
file: /.gitlab/ci/single/docker-hub.yaml
variables:
DOCKER_ARCH: amd64,arm64
build-one-arch:
extends:
- .build-one-arch
build-all-arch:
extends:
- .build-all-arch
parallel:
matrix:
- DOCKER_TAG_SUFFIX: [amd64, arm64]
needs: ['build-one-arch']
build-manifest-create:
extends:
- .build-manifest-create
needs: ['build-all-arch']
build-metadata-push:
extends:
- .build-metadata-push
needs: ['build-manifest-create']
Content type
Image
Digest
sha256:e6b84a299…
Size
87.3 MB
Last updated
3 months ago
docker pull agrozyme/podman-qemu