Skip to content

Between 1.27.0 and 1.27.4 the handling of volume config option "device" has changed #7856

@maaarghk

Description

@maaarghk

Description of the issue

I have a compose file with a section like this:

volumes:
  app_data:
    driver_opts:
      type: none
      device: "${PWD}/../../www/"
      o: bind

On docker-compose 1.27.0 a volume is created like so:

$ docker inspect --format='{{ .Options.device }}' composeproject_app_data
/home/mark/Code/composeproject/ops/dev/../../www/

After upgrading to 1.27.4 the following error is raised after trying to bring the containers up:

ERROR: Configuration for volume app_data specifies "device" driver_opt /home/mark/Code/composeproject/www, but a volume with the same name uses a different "device" driver_opt (/home/mark/Code/composeproject/ops/dev/../../www/). If you wish to use the new configuration, please remove the existing volume "composeproject_app_data" first

In other words, 1.27.4 is resolving the "../.." in the path whereas 1.27.0 is not.

This behaviour should only change with a new compose file definition version.

Of course you will also need to worry about people who just freshly installed 1.27.4 coming in and whinging like me that backwards compatibility was broken between .4 and .5 when you make the fix :) 🏅

Context information (for bug reports)

Output of docker-compose version
Broken:

docker-compose version 1.27.4, build unknown
docker-py version: 4.3.1
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020

Working:

docker-compose version 1.27.0, build unknown
docker-py version: 4.3.1
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020

Output of docker version

Client:
 Version:           19.03.12-ce
 API version:       1.40
 Go version:        go1.14.5
 Git commit:        48a66213fe
 Built:             Sat Jul 18 01:33:21 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.12-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.14.5
  Git commit:       48a66213fe
  Built:            Sat Jul 18 01:32:59 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.4.1.m
  GitCommit:        c623d1b36f09f8ef6536a057bd658b3aa8632828.m
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Steps to reproduce the issue

  1. Have a volume mount specified as per above with relative paths
  2. Start with 1.27.0
  3. Upgrade
  4. Fail to start with 1.27.4

Observed result

Containers don't come up

Expected result

Containers come up

Additional information

Manjaro Linux on kernel 5.9-rc3

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