Building Docker images on GitLab CI: Docker-in-Docker and Podman

If you’re using GitLab CI to build your software, you might also want to use it to build Docker images of your application.
This can be a little tricky, because by default GitLab CI runs jobs inside Docker containers.

The standard technique for getting around this problem is using Docker-in-Docker, but you can also use a simpler technique by using Podman, the reimplemented version of Docker.
Let’s see why and how.

Option #1: Docker-in-Docker

When you run the docker command-line tool, it is actually not doing much work itself.
Instead, it talks to dockerd, a daemon or server typically running on the same machine where you’re running the CLI.
The actual work of running a container or building an image is done by dockerd.

 

 

 

To finish reading, please visit source site