gitlab-ci-multiplatform

This is an old revision of the document!


Gitlab CI MultiPlatform Build

Enable Emulators

# docker run -it --rm --privileged tonistiigi/binfmt --install all
{
  "supported": [
    "linux/amd64",
    "linux/arm64",
    "linux/riscv64",
    "linux/ppc64le",
    "linux/s390x",
    "linux/386",
    "linux/arm/v7",
    "linux/arm/v6"
  ],
  "emulators": [
    "qemu-aarch64",
    "qemu-arm",
    "qemu-ppc64le",
    "qemu-riscv64",
    "qemu-s390x"
  ]
}

Switch to buildx in .gitlab-ci.yml

.gitlab-ci.yml
image: docker
 
services:
  - docker:dind
 
build:
  stage: build
  script:
    - docker login -u $CI_USER -p $CI_TOKEN $CI_REGISTRY
    - export DOCKER_CLI_EXPERIMENTAL=enabled
    - export DOCKER_BUILDKIT=1
    - docker buildx create --use
    - docker buildx build --platform $CI_PLATFORMS --push --pull -t $CI_IMAGE .
gitlab-ci-multiplatform.1610089688.txt.gz · Last modified: 2021/01/08 08:08 by baumi

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki