Building multi-arch images using GitLab

Image Credit : https://about.gitlab.com/press/

Pre-requisites

  • IBM Power resource to setup GitLab Runner for building ppc64le image
  • x86 resource to setup GitLab Runner for building x86 image
  • Install Docker on x86 VM
yum install -y yum-utils

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-compose-pluginsystemctl start docker
  • Install Docker on Power VM
mkdir /root/docker; cd /root/dockerwget https://oplab9.parqtec.unicamp.br/pub/ppc64el/docker/version-19.03.7/centos/docker-ce-19.03.7-3.el7.ppc64le.rpmwget https://oplab9.parqtec.unicamp.br/pub/ppc64el/docker/version-19.03.7/centos/docker-ce-cli-19.03.7-3.el7.ppc64le.rpmwget https://oplab9.parqtec.unicamp.br/pub/repository/rpm/ppc64le/containerd/containerd-1.6.4-1.ppc64le.rpmyum install docker-ce-cli-19.03.7-3.el7.ppc64le.rpm docker-ce-19.03.7-3.el7.ppc64le.rpm containerd-1.2.14-1.el7.ppc64le.rpmservice docker start
  • Add permission to execute docker commands on x86 and Power runners
sudo usermod -aG docker gitlab-runnersudo service docker restart
  • Setup Robot user on quay repository

Building multi-arch images

  1. Import GitLab pipeline source code
curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/rpm/gitlab-runner_<arch>.rpm"rpm -i gitlab-runner_<arch>.rpmgitlab-runner --version
gitlab-runner register
ROBOT_USER : Quay Robot User
ROBOT_TOKEN : Quay Robot Token
QUAY_REPO : Quay repo to publish the images eg. quay.io/<user>
docker pull quay.io/snehakpersistent/test-gitlab:multi-arch-gitlab-latest

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sneha Kanekar

Sneha Kanekar

Engineering Lead at Persistent Systems