I was in need of a quick example of setting up a local GitLab instance, running on Podman. So here is a quick and dirty docker-compose setup for doing that.
At the end of this brief example you might also want to have a peek at https://docs.gitlab.com/runner/executors/docker.html#use-podman-to-run-docker-commands
IMHO, Let's just say that while Podman is the future:) it still has some ecosystem quirks bugs and issues, some in Podman, or in friends. But, getting there, every day.
-
Podman 4.6.2++ installed and working. This means
Podman running as a service:
podman info | grep -A2 'remoteSocket' # should list exists true and the socket
Alias has been set, bye docker
alias docker=podman # has been set
DOCKER_HOST has been exported (sneaky, here is the podman socket)
export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock or whatever your podman socket is
-
docker-compose /yes you sadly still need this as podman-compose is not up to the task yet. But we are using podman underneath.
-
docker-compose up Note: Before you have configured your first runner there will be some errors here of type "ERROR: Failed to load config stat /etc/gitlab-runner/config.toml:". Just ignore.
Change root password for gitlabce
-
podman exec -it gitlab-ce gitlab-rake "gitlab:password:reset[root]"
-
docker-compose down && docker-compose un
-
Go to the GitLab UI at 127.0.0.1 or 10.89.0.2 :) and login with root/pw-you-changed-to
-
Search for admin area in GUI (Search -> Admin)
-
Add new instance runner under CI (if the ip changes suddenly here after applying, just change it back and enter, it has happened a few times)
-
You should now see an instruction page for how to register the runner, and a token.
-
Follow the above steps by exec into the running runner and do i.e run gitlab-runner register. (you will change some values later so dont worry if there are some errors here).
podman exec -it gitlab-runner /bin/bash gitlab-runner register ...follow steps
-
Still in the runner container : vi /etc/gitlab-runner/config.toml
-
Have a look at the runner.example.toml in this project and add what you need: host, privileged and FF_NET.. are needed for podman at least.
-
docker-compose down && docker-compose, login to ui, check that the runner is online in the admin area
-
Add a testproject, ci pipes, have fun!!