I've encountered a similar issue to https://github.com/docker/compose/issues/4751
I broke down the error in to a minimal setup to reproduce which can be found in this repository: https://github.com/usr42/docker-compose-error-duplicate-mount-point (Just run reproduce_error.sh inside the repo).
TL;DR:
When I define a volume in the docker-compose.yml which was already defined in docker image (with VOLUME
inside the Dockerfile) this issue happens then the service is changed and so an update is triggered. I then get following error:
Recreating dockercomposeerrorduplicatemountpoint_svc_1 ... error
ERROR: for dockercomposeerrorduplicatemountpoint_svc_1 Cannot create container for service svc: Duplicate mount point: /mnt
ERROR: for svc Cannot create container for service svc: Duplicate mount point: /mnt
ERROR: Encountered errors while bringing up the project.
Output of "docker-compose version"
docker-compose version 1.20.1, build 5d8c71b
docker-py version: 3.1.4
CPython version: 3.6.4
OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
Output of "docker version"
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:06:22 2018
OS/Arch: darwin/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:14:32 2018
OS/Arch: linux/amd64
Experimental: true
Output of "docker-compose config"
services:
svc:
build:
context: /Users/bbiederm/git-repos/docker-compose-error-duplicate-mount-point
volumes:
- source: vol
target: /mnt
type: volume
version: '3.2'
volumes:
vol: {}
Content of docker-compose.yml:
version: '3.2'
services:
svc:
build:
context: .
volumes:
- type: volume
source: vol
target: /mnt
volumes:
vol:
Content of Dockerfile:
FROM alpine:latest
VOLUME ["/mnt"]
CMD ["ping","google.com"]
After triggering a service upgrade by changing the command and running docker-compose -f up -d
, the upgrade failed with the error:
Cannot create container for service svc: Duplicate mount point: /mnt
The service should be upgraded without an error
Recreating dockercomposeerrorduplicatemountpoint_svc_1 ... error
ERROR: for dockercomposeerrorduplicatemountpoint_svc_1 Cannot create container for service svc: Duplicate mount point: /mnt
ERROR: for svc Cannot create container for service svc: Duplicate mount point: /mnt
ERROR: Encountered errors while bringing up the project.
Thank you for the report and the repro case. I'll look into it!
Thanks for the replay.
Please tell me, if you need more data.
any workarround ?
For me it a docker-compose down && docker-compose up
worked.
@shin- Thanks for fixing the issue.
I've just tested with the newest master version and I can approve that the bug is fixed.
I'm still seeing this issue with docker-compose 1.21.2 and 1.21.1.
$ docker-compose config
services:
wfmgmt:
image: mvs-wfmgmt:2018.04.1814218Z
volumes:
- source: workspaces
target: /opt/mvs/data/__workspaces__
type: volume
version: '3.6'
volumes:
workspaces: {}
$ docker-compose --verbose up
Recreating 22bab84e5e2a_pods_wfmgmt_1 ...
compose.parallel.feed_queue: Pending: {<Container: 22bab84e5e2a_pods_wfmgmt_1 (22bab8)>}
compose.parallel.feed_queue: Starting producer thread for <Container: 22bab84e5e2a_pods_wfmgmt_1 (22bab8)>
compose.cli.verbose_proxy.proxy_callable: docker stop <- ('22bab84e5e2a6b01d82c2682b4a9bc59bd7456831380a69da8122773e9a9d7a8', timeout=10)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.36/containers/22bab84e5e2a6b01d82c2682b4a9bc59bd7456831380a69da8122773e9a9d7a8/stop?t=10 HTTP/1.1" 304 0
compose.cli.verbose_proxy.proxy_callable: docker stop -> None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mvs-wfmgmt:2018.04.1814218Z')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.36/images/mvs-wfmgmt:2018.04.1814218Z/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'AttachStderr': True,
'AttachStdin': False,
'AttachStdout': True,
'Cmd': None,
'Domainname': '',
'Entrypoint': ['python',
'-m',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('sha256:4e9f16eb5b4c4a9403531c57cd4f13cc227149d5360b63fec5d11443d12a0f13')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.36/images/sha256:4e9f16eb5b4c4a9403531c57cd4f13cc227149d5360b63fec5d11443d12a0f13/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'AttachStderr': True,
'AttachStdin': False,
'AttachStdout': True,
'Cmd': None,
'Domainname': '',
'Entrypoint': ['python',
'-m',
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mvs-wfmgmt:2018.04.1814218Z')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.36/images/mvs-wfmgmt:2018.04.1814218Z/json HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {'Architecture': 'amd64',
'Author': '',
'Comment': '',
'Config': {'AttachStderr': True,
'AttachStdin': False,
'AttachStdout': True,
'Cmd': None,
'Domainname': '',
'Entrypoint': ['python',
'-m',
...
compose.service.build_container_labels: Added config hash: 1857ffada7051f430749c5ed61472cdebd05b681d9cd30a944f634f73aaac449
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (links=[], port_bindings={}, binds=['pods_scans:/opt/mvs/data/MVS_MAP_DATA_BACKUP_1:rw', 'f3492a2b92d6832f14137ece7131d6dcc753c32ac054731c9aa2408a576bbe98:/opt/mvs/config:rw', 'pods_data-storage:/opt/mvs/data/data_storage:rw', '7332000bd9f44ea00a91349cb4c761b16c8ca3bda91f900b3ceb4f840f2849c5:/reprepro:rw', 'pods_workspaces:/opt/mvs/data/__workspaces__:rw', '104824e2694e86a45b2970d99dd2a27a3155ed5ef01048e35d24a2072f98d71d:/opt/mvs/data/MVS_MAP_DATA:rw'], volumes_from=[], privileged=False, network_mode='pods_default', devices=None, dns=None, dns_opt=None, dns_search=None, restart_policy=None, runtime=None, cap_add=None, cap_drop=None, mem_limit=None, mem_reservation=None, memswap_limit=None, ulimits=None, log_config={'Type': '', 'Config': {}}, extra_hosts=None, read_only=None, pid_mode=None, security_opt=None, ipc_mode=None, cgroup_parent=None, cpu_quota=None, shm_size=None, sysctls=None, pids_limit=None, tmpfs=None, oom_kill_disable=None, oom_score_adj=None, mem_swappiness=None, group_add=None, userns_mode=None, init=None, init_path=None, isolation=None, cpu_count=None, cpu_percent=None, nano_cpus=None, volume_driver=None, cpuset_cpus=None, cpu_shares=None, storage_opt=None, blkio_weight=None, blkio_weight_device=None, device_read_bps=None, device_read_iops=None, device_write_bps=None, device_write_iops=None, mounts=[{'Target': '/opt/mvs/data/__workspaces__', 'Source': 'pods_workspaces', 'Type': 'volume', 'ReadOnly': None}], device_cgroup_rules=None, cpu_period=None, cpu_rt_period=None, cpu_rt_runtime=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': ['pods_scans:/opt/mvs/data/MVS_MAP_DATA_BACKUP_1:rw',
'f3492a2b92d6832f14137ece7131d6dcc753c32ac054731c9aa2408a576bbe98:/opt/mvs/config:rw',
'pods_data-storage:/opt/mvs/data/data_storage:rw',
'7332000bd9f44ea00a91349cb4c761b16c8ca3bda91f900b3ceb4f840f2849c5:/reprepro:rw',
'pods_workspaces:/opt/mvs/data/__workspaces__:rw',
'104824e2694e86a45b2970d99dd2a27a3155ed5ef01048e35d24a2072f98d71d:/opt/mvs/data/MVS_MAP_DATA:rw'],
'Links': [],
'LogConfig': {'Config': {}, 'Type': ''},
'Mounts': [{'ReadOnly': None,
'Source': 'pods_workspaces',
...
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (image='mvs-wfmgmt:2018.04.1814218Z', volumes={}, name='pods_wfmgmt_1', detach=True, environment=['affinity:container==22bab84e5e2a6b01d82c2682b4a9bc59bd7456831380a69da8122773e9a9d7a8'], labels={'com.docker.compose.project': 'pods', 'com.docker.compose.service': 'wfmgmt', 'com.docker.compose.oneoff': 'False', 'com.docker.compose.container-number': '1', 'com.docker.compose.version': '1.21.2', 'com.docker.compose.config-hash': '1857ffada7051f430749c5ed61472cdebd05b681d9cd30a944f634f73aaac449'}, host_config={'NetworkMode': 'pods_default', 'VolumesFrom': [], 'Binds': ['pods_scans:/opt/mvs/data/MVS_MAP_DATA_BACKUP_1:rw', 'f3492a2b92d6832f14137ece7131d6dcc753c32ac054731c9aa2408a576bbe98:/opt/mvs/config:rw', 'pods_data-storage:/opt/mvs/data/data_storage:rw', '7332000bd9f44ea00a91349cb4c761b16c8ca3bda91f900b3ceb4f840f2849c5:/reprepro:rw', 'pods_workspaces:/opt/mvs/data/__workspaces__:rw', '104824e2694e86a45b2970d99dd2a27a3155ed5ef01048e35d24a2072f98d71d:/opt/mvs/data/MVS_MAP_DATA:rw'], 'PortBindings': {}, 'Links': [], 'LogConfig': {'Type': '', 'Config': {}}, 'Mounts': [{'Target': '/opt/mvs/data/__workspaces__', 'Source': 'pods_workspaces', 'Type': 'volume', 'ReadOnly': None}]}, networking_config={'EndpointsConfig': {'pods_default': {'Aliases': ['wfmgmt'], 'IPAMConfig': {}}}})
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.36/containers/create?name=pods_wfmgmt_1 HTTP/1.1" 400 66
Recreating 22bab84e5e2a_pods_wfmgmt_1 ... error
compose.parallel.feed_queue: Pending: set()
ERROR: for 22bab84e5e2a_pods_wfmgmt_1 Cannot create container for service wfmgmt: Duplicate mount point: /opt/mvs/data/__workspaces__
compose.parallel.parallel_execute_iter: Failed: <Service: wfmgmt>
compose.parallel.feed_queue: Pending: set()
ERROR: for wfmgmt Cannot create container for service wfmgmt: Duplicate mount point: /opt/mvs/data/__workspaces__
ERROR: compose.cli.main.main: Encountered errors while bringing up the project.
$ docker-compose version
docker-compose version 1.21.2, build a133471
docker-py version: 3.3.0
CPython version: 3.6.5
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
$ docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:18:46 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:16:59 2018
OS/Arch: linux/amd64
Experimental: false
@bbrinzer-mvs I cannot reproduce it with my POC. Maybe you should open a new issue, so your issue does not get lost.
@usr42 Thanks for the suggestion, I will do that!
For me it a docker-compose down && docker-compose up worked.
Is there any better solution than this? I encounter this issue with every Compose project with volumes that I've used, and docker-compose down
brings down all of my services in the Compose file, including ones that don't rely on volumes.
Most helpful comment
For me it a
docker-compose down && docker-compose up
worked.