redhat-actions / buildah-build

GitHub Action to use 'buildah' to build a container image.
https://github.com/marketplace/actions/buildah-build
MIT License
136 stars 35 forks source link

[BUG] Buildah not running as root on self hosted runners #125

Open omer2500 opened 10 months ago

omer2500 commented 10 months ago

Version

redhat-actions/buildah-build@v2

Describe the bug

When using self hosted runner that runs ubuntu 22.04 the default user is "runner" instead of root this causes errors related to permission to some folders and files. although we have option to run as root user but its only when you use sudo command which is not possible with this action

for example:

Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:50 for /var/local): Check /etc/subuid and /etc/subgid: lchown /var/local: invalid argument
time="2023-08-28T19:49:27Z" level=error msg="exit status 125"

and

time="2023-08-28T19:49:26Z" level=warning msg="error running newgidmap: exit status 1: newgidmap: write to gid_map failed: Operation not permitted\n"
time="2023-08-28T19:49:26Z" level=warning msg="falling back to single mapping"
time="2023-08-28T19:49:26Z" level=warning msg="error running newuidmap: exit status 1: newuidmap: write to uid_map failed: Operation not permitted\n"
time="2023-08-28T19:49:26Z" level=warning msg="falling back to single mapping"

When i run the buildah command with sudo (not part of the action) everything is working

sudo /usr/bin/buildah bud .....

Steps to reproduce, workflow links, screenshots

Use ARC (actions controller runner) with the runner image: "summerwind/actions-runner:ubuntu-22.04"

omer2500 commented 10 months ago

126

joerg commented 7 months ago

I have the exact same problem right now and it took ma almost a day to find this issue. Thanks a lot and I hope the PR will be merged soon.

omer2500 commented 6 months ago

I have the exact same problem right now and it took ma almost a day to find this issue. Thanks a lot and I hope the PR will be merged soon.

Hi! @joerg if it relevant to you we ended up doing a workaround, we are using the cli of buildah and podman directly