Skip to content

Conversation

@DE-AI
Copy link

@DE-AI DE-AI commented Jun 12, 2025

Setup

I'm running a non privileged gitlab-runner (docker executor) with a podman host. Podman is configured rootless and the socket runs with systemd under the user gitlab-runner. Subids are configured for that user.

Problem description

Using the podman image inside a gitlab ci job doesn't work because the container uses the user root. For Rootless Podman running rootless Podman the container should run with user podman as described in this blog post. However I still want to run the container as root because sometimes I need to install additional packages to complete the ci job. The downside here is that I always need to use runuser -u podman -- podman info

Proposed solution

To simplify the rootless podman call this PR includes a helper script called podman-rootless into the podman image which allows to run the podman command as podman user.
In the CI pipeline I can simply run podman-rootless info now.

There's another helper script run-as-podman to run arbitrary commands as user podman. For example to create new directories run-as-podman mkdir /path/.

@Luap99
Copy link
Member

Luap99 commented Jun 17, 2025

Thanks, should be fine to add these but can you please add some description about these two scripts in the readme so it is documented for others.

cc @timcoding1988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants