Skip to content

nerdctl silently ignores tmpfs volume configuration #4556

@gtsiam

Description

@gtsiam

Description

nerdctl compose up fails to configure containers with tmpfs volumes and silently creates an anoymous volume instead.

My SSD is not very happy.

Steps to reproduce the issue

  1. Create a test compose file with a tmpfs mount:
name: test
services:
  test:
    image: alpine
    volumes:
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1073741824 # 1GB
  1. Run nerdctl compose up.

Describe the results you received and expected

An anonymous volume is created, instead of the tmpfs configured in compose.yaml:

nerdctl inspect test-test-1 | jq '.[].Mounts[]'
{
  "Type": "volume",
  "Name": "ee5270c6228ed7b8f75b486c151454c68954146ad700063c93754d0b0e6aaf91",
  "Source": "/var/lib/nerdctl/1935db59/volumes/default/ee5270c6228ed7b8f75b486c151454c68954146ad700063c93754d0b0e6aaf91/_data",
  "Destination": "/tmp/cache",
  "Driver": "local",
  "Mode": "",
  "RW": true,
  "Propagation": ""
}

What version of nerdctl are you using?

nerdctl 2.1.6

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions