Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Service volume option subpath is being ignored #1188

Copy link
Copy link
Open
@awmath

Description

@awmath
Issue body actions

Describe the bug
The subpath volume option for services is getting ignored. Even though it is part of the compose spec: https://github.com/compose-spec/compose-spec/blob/main/05-services.md#volumes

To Reproduce
Steps to reproduce the behavior:

  1. use this compose file:
services:
  create-data:
    image: alpine
    command:
      - ash
      - -c
      - |
        mkdir -p /mnt/sub  
        echo "full" > /mnt/testfile
        echo "sub" > /mnt/sub/testfile
    volumes:
      - data:/mnt

  test-full:
    image: alpine
    command: cat /mnt/testfile
    depends_on:
      create-data:
        condition: service_completed_successfully
    volumes:
      - type: volume
        source: data
        target: /mnt

  test-subpath:
    image: alpine
    command: cat /mnt/testfile
    depends_on:
      create-data:
        condition: service_completed_successfully
    volumes:
      - type: volume
        source: data
        target: /mnt
        volume:
          nocopy: true
          subpath: sub/

volumes:
  data:
  1. execute podman-compose up

Expected behavior
The test-full service should exit echoing "full".
The test-subpath service should exit echoing "sub".

Actual behavior
Both services exit with echoing "full"

[test-subpath] | full
[test-full]    | full

Environment:

  • OS: Linux
  • podman version: 5.4.2
  • podman compose version: 1.3.0

Additional context

The Command to create the test-subpath container is

INFO:podman_compose:podman create --name=podman-compose-subvolume_test-subpath_1 --pod=pod_podman-compose-subvolume --requires=podman-compose-subvolume_create-data_1 ... -v podman-compose-subvolume_data:/mnt ... alpine cat /mnt/testfile

Which is missing the subpath option (which is supported by podman since 5.4.0).
Manually executing:
podman run --rm -it --mount type=volume,source=podman-compose-subvolume_data,target=/mnt,subpath=sub alpine cat /mnt/testfile does in fact work.

The subpath option is working with docker-compose and docker as well as podman kube play and podman run/create
But not with docker-compose using podman (containers/podman#25992)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.