skip to Main Content

1. Summarize the problem

I am following this simple tutorial from Developers RedHat to get a simple node/express container working.

I cannot get a container to run under a CentOS 7 VM on GCE.

I have a CentOS 7 GCE virtual machine, where I have Docker installed.

I am able to successfully build and run Docker containers and push them to Google’s container registry with no problem.

Now I am trying to build podman/buildah containers, and do the same.
I have buildman/podman installed. When I run this:

podman build -t hello-world-nodejs .

I get the following error message:

cannot clone: Invalid argument user namespaces are not enabled in /proc/sys/user/max_user_namespaces Error: could not get runtime: cannot re-exec process

any ideas?

Additionally, if there are any guides into getting this image into Google’s container registry, and running under Cloud Run, it would be greatly appreciated.

Ultimately the destination for some containers is a cloud service.

2. Provide background including what you’ve already tried

I have tried doing a web search for a solution, nothing found that has solved the problem so far.

3. Show some code

podman build -t hello-world-nodejs .

4. Describe expected and actual results including any error messages

I can create and run docker images/containers on this GCE VM, I am trying to do the same with buildah/podman.

2

Answers


  1. I have spun up a CentOS 7 VM on GCE and got same issue. The issue is caused because User Namespaces is not enabled on the kernel by default. You have 2 options, either running podman as root (or using sudo) or enabling User Namespaces in your CentOS VM (the hard way).

    According to the post here, the use of user namespace and the allocations of uid and gid’s that are required to make rootless containers work securely in your environment.

    Probably StackOverflow is not the best place to ask this question. It’s better to ask in the ServerFault site since it’s a server and not coding problem.

    Login or Signup to reply.
  2. The following solved this issue for me:

    sudo bash -c 'echo 10000 > /proc/sys/user/max_user_namespaces'
    sudo bash -c "echo $(whoami):110000:65536 > /etc/subuid"
    sudo bash -c "echo $(whoami):110000:65536 > /etc/subgid"
    

    And then if you encounter an errors related to lchown run the following:

    sudo rm -rf ~/.{config,local/share}/containers /run/user/$(id -u)/{libpod,runc,vfs-*}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search