Alpine-based image with docker client, buildx, and qemu. Easily allows cross platform image builds.
10K+
Source: https://gitlab.com/agrozyme-docker/docker-buildx-qemu
Alpine-based image with docker client, buildx, and qemu. Easily allows cross platform image builds.
Inspired By jonoh/docker-buildx-qemu
It's been tested with GitLab CI on gitlab.com, but it should work anywhere that docker-in-docker already works, and with a binfmt_misc enabled kernel.
The Docker image can run in the environment (The intersection of Alpine and Docker Buildx support platforms):
This Docker image can emulate the environments:
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 build-all-arch 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: Login password encoded by base64DOCKER_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_PLATFORM
linux/amd64,linux/arm64.It 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.docker buildx and you can speed up the build of multi-platform docker image.This GitLab example should give you an idea of how to use the image.
.gitlab-ci.yml
include:
- project: 'agrozyme-docker/docker-buildx-qemu'
ref: main
file: '/.gitlab/ci/single/docker-hub.yaml'
build-one-arch:
extends:
- .build-one-arch
build-all-arch:
extends:
- .build-all-arch
needs: ['build-one-arch']
build-metadata-push:
extends:
- .build-metadata-push
needs: ['build-all-arch']
Content type
Image
Digest
sha256:a4cd3b52a…
Size
90.2 MB
Last updated
10 months ago
docker pull agrozyme/docker-buildx-qemu