Building multi-arch images using self-hosted runners on GitHub Actions

Image credits: invicti.com

Pre-requisites:

  • User account on GitHub
  • x86 VM for adding a self-hosted runner to the GitHub repository
  • ppc64le VM for executing the GitHub Actions workflow
  • Install Docker on x86 VM
yum install -y yum-utils

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repoyum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl 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
  • Setup Robot user on quay repository

Building multi-arch image workflow

  1. Setup SSH key authentication
cd ~/.sshssh-keygen -o -t rsa
vi ~/.ssh/authorized_keys
ssh -i /root/.ssh/id_rsa username@hostname
PPC64LE_IP : IP of ppc64le VM
GH_REPO : Name of your GitHub Repo
GH_USER : Your GitHub username
QUAY_REPO : Quay repository username for publishing images eg. quay.io/<user>
ROBOT_USER : Quay Robot user
ROBOT_TOKEN : Quay Robot token

--

--

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