Skip to content

Support bind propagation options in Compose volume long syntax #3897

Closed
@dancavallaro

Description

@dancavallaro

What is the problem you're trying to solve

I have a use case that requires configuring propagation options on a bind mount defined in a Compose file, but nerdctl compose does not currently support bind propagation options.

For example, using this Compose file:

services:
  nginx:
    container_name: nginx
    image: nginx:alpine
    volumes:
      - type: bind
        source: ./mnt
        target: /mnt
        read_only: true
        bind:
          propagation: shared

then running sudo nerdctl compose up -d results in this warning, and the propagation option being ignored:

WARN[0000] Ignoring: volume: Bind: [Propagation]

nerdctl run already supports this, it's just a matter of supporting the additional propagation option when parsing the compose file to generate the nerdctl run command.

Describe the solution you'd like

I would like nerdctl compose to parse propagation options and pass them to the underlying nerdctl run command. I've already implemented this with a unit test (plus manual testing): dancavallaro@e764188.

Any objection to accepting this contribution if I open a PR? Are there any changes you'd like to see before I do that?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions