Dealing with containers on the mainframe has its very own challenges. Sometimes you find a s390x container image and want to run it for testing or development. Normally you would have to do that on the mainframe.
It is possible to run s390x container images on x86_64 using qemu to emulate the s390x architecture and podman as the container runtime on Linux. Required are:
- Linux
- qemu-user-static with s390x support (the package names vary by distribution)
- Podman
To specify that you want an s390x image, all you need is the --arch s390x
argument to podman. The rest is handled automatically.
To start an interactive shell in an Alpine container for example, the following command can be used:
$ uname -a Linux fedora 5.16.18-100.fc34.x86_64 #1 SMP PREEMPT Mon Mar 28 14:46:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux $ podman run -it --arch s390x alpine /bin/sh / # uname -a Linux 9dbc9d4df4db 5.16.18-100.fc34.x86_64 #1 SMP PREEMPT Mon Mar 28 14:46:06 UTC 2022 s390x Linux