nerdctl: /dev/shm support is broken (Was: `What options does the --tmpfs flag in the run statement allow`)

I’m trying to a run an Oracle Database in a Docker image in a lima environment on macOS and get a lot of errors related to the shm volume.

lima nerdctl run --detach --name="oracledb" --network="oraclenet" --memory="4g" --publish="1521:1521" --volume="/dev/shm" --tmpfs="/dev/shm:rw,exec,size=1g" qualiant/database

As there is no specific documentation, I wanted to ask a few specific questions:

  1. Does nerdctl all the options --tmpfs="/dev/shm:rw,exec,size=1g" in the --tmpfs flag ?
  2. nerdctl support the --memory option but how does this relate to lima? Is it guaranteed that the container gets 4g when using the --memory flag independently from lima?

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

looks like it is related to lima; lima add uid=501,gid=1000 to the mount so you are not mouting /dev/shm as user 0. I assume that the image user != 0 so either you need to be root in your container or mount with the same user as you container.

nerdctl run --rm --tmpfs="/dev/shm:rw,exec,size=1g" alpine grep /dev/shm /proc/mounts
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime,size=1048576k 0 0
lima nerdctl run --rm --tmpfs="/dev/shm:rw,exec,size=1g,uid=1,gid=1" alpine grep /dev/shm /proc/mounts
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime,size=1048576k,uid=100000,gid=100000,inode64 0 0

I assume that lima using vm user to make this mount which is logic, but When I tried to force user 0 , it dosen’t wort

lima nerdctl run --rm --tmpfs="/dev/shm:rw,exec,size=1g,uid=0,gid=0" alpine grep /dev/shm /proc/mounts
tmpfs /dev/shm tmpfs rw,nosuid,nodev,relatime,size=1048576k,uid=501,gid=1000,inode64 0 0

Do you we have a root mode in lima @AkihiroSuda @Junnplus ?