opencontainers / opencontainers/runc

Getting "mkdir /run/runc: permission denied" on CentOS when run as unprivileged user

Open
#2,960 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/question
Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

By default, runc uses "/run/runc" for container state. On CentOS the /run directory is owned by root and non-privileged user cannot write to it, so I'm getting this error:

mkdir /run/runc: permission denied
ls -la /
...
drwxr-xr-x   30 root root  1020 May 24 21:20 run
$ runc --version
runc version 1.0.0-rc93
commit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
spec: 1.0.2-dev
go: go1.13.15
libseccomp: 2.3.1

I'm running img which uses runc and I was wondering if there a way to overwrite the --root global option via environment variable and not command line argument ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with runc's CLI handling of the global --root option and reproduce the permission error as an unprivileged user on CentOS. Determine whether the state root can be selected without a command-line argument; done means an unprivileged invocation can use a writable state directory and no longer attempts to create /run/runc.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.