Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Compose shm_size service option support #2267

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

surenkov
Copy link
Contributor

@surenkov surenkov commented May 31, 2023

Since --shm-size option is supported by nerdctl run command, it is also nice to have its counterpart from Compose file specification.

Example configuration

version: '3.9'

services:
  test-plain:
    image: debian:buster-slim
    command: grep shm /proc/self/mounts
  test-shm:
    image: debian:buster-slim
    shm_size: 1G
    command: grep shm /proc/self/mounts

Before fix:

$ nerdctl compose -f compose.yml run test-plain
INFO[0000] Ensuring image debian:buster-slim
INFO[0000] Creating container nerdctl_test-plain_run_bdf02686b2bc
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,uid=501,gid=1000,inode64 0 0

$ nerdctl compose -f compose.yml run test-shm
WARN[0000] Ignoring: service test-shm: [ShmSize]
INFO[0000] Ensuring image debian:buster-slim
INFO[0000] Creating container nerdctl_test-shm_run_0715f6c50f71
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,uid=501,gid=1000,inode64 0 0

After fix:

$ nerdctl compose -f compose.yml run test-plain
INFO[0000] Ensuring image debian:buster-slim
INFO[0000] Creating container nerdctl_test-plain_run_128ffac7cffb
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k,uid=501,gid=1000,inode64 0 0

$ nerdctl compose -f compose.yml run test-shm
INFO[0000] Ensuring image debian:buster-slim
INFO[0000] Creating container nerdctl_test-shm_run_e6afbb4dbe93
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=1048576k,uid=501,gid=1000,inode64 0 0

@surenkov surenkov changed the title Compose shm size Add Composeshm_size service option support May 31, 2023
@surenkov surenkov changed the title Add Composeshm_size service option support Add Compose shm_size service option support May 31, 2023
@AkihiroSuda
Copy link
Member

Thanks, could you squash commits?

Signed-off-by: Savva Surenkov <savva@surenkov.space>
@surenkov
Copy link
Contributor Author

surenkov commented Jun 1, 2023

@AkihiroSuda done, thank you!

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 8b35063 into containerd:main Jun 2, 2023
@surenkov surenkov deleted the compose-shm-size branch June 9, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants