Fortunately, and thanks to the Open Containers Initiative, there's now an alternative to Docker created by RedHat: Buildah is a tool for creating containers, while Podman runs the containers. All of them, in userspace.
That's the catch, however. It needs some other tools to build and run stuff. Let's use them, for instance, to build and run this minimal Alpine dockerfile
But you can install all of them in easy steps in Ubuntu:
- Install Buildah. Just add the corresponding repo and download it:
sudo apt-get update -qq sudo apt-get install -qq -y software-properties-common sudo add-apt-repository -y ppa:projectatomic/ppa sudo apt-get update -qq sudo apt-get -qq -y install buildah
You need to install
runcto actually use the command
RUNinside the Dockerfile. That pretty straighforward:
sudo apt-get install runc. The catch with this is that it uninstalls
docker-ce, so you're left without your good old docker. If you are not comfortable with this, just skip the installation of Buildah or use it only for images that don't need to use
You're good to go now building the container.
budis the equivalent here of
buildin good old docker CLI:
buildah bud -f alpine/Dockerfile -t your-name-here/alpine-hola-mundo
You can use any container, that's the command if you downloaded the repo above
- Let's go and run it. We need to install
slirp4netns, a tool for user-mode networking. Next step will work without this, but you'll get a nasty error (and might fail when actual networking is used):
sudo apt install slirp4netns
- Installing podman is a breeze, with all the repos added and everything
sudo apt install podman
- Ready to run!
podman run -t your-name-here/alpine-hola-mundo
It's a nice alternative just because it's an alternative, and then because you don't actually need to run a daemon to run containers, so your sysop might be better sold with this.
Update: I tried it on another machine, and it just didn't work, even with the same operating system. Might be this toolchain still has some issues. I posted them where they correspond, I'll update when they are solved.