Buildah is an alternative tool to build container images that can be configured to run without root access. Buildah can work with regular Dockerfiles, which we discussed earlier. It also presents its own command-line interface that you can use in shell scripts or other automation you find more intuitive. One of the previous Dockerfiles rewritten as a shell script using the buildah interface will look like this:
#!/bin/sh
ctr=$(buildah from ubuntu:bionic)
buildah run $ctr -- /bin/sh -c 'apt-get update && apt-get install -y build-essential gcc'
buildah config --cmd '/usr/bin/gcc' "$ctr"
buildah commit "$ctr" hosacpp-gcc
buildah rm "$ctr"
One interesting feature of Buildah is that it allows you to mount the container image filesystem into your host filesystem. This way, you can use your host's commands to interact with the contents of the image. If you have software you don't want (or can't due to licensing restrictions...