Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volumes override doesn't work #5203

Closed
OnkelTem opened this issue Sep 20, 2017 · 3 comments
Closed

Volumes override doesn't work #5203

OnkelTem opened this issue Sep 20, 2017 · 3 comments

Comments

@OnkelTem
Copy link

I have both docker-compose.yml and its override file. The essential part of the content is:

docker-compose.yml:

version: "3"
services:
  web:
    volumes:
      - "../app:/var/www/drupal:ro"

docker-compose.override.yml:

version: "3"
services:
  web:
    volumes:
      - "../app:/var/www/drupal:rw"
      - "./environments/local/data/composer:/home/developer/.composer:rw"

For some reason the override for ../app doesn't work - it is mounted in ro mode. But if comment out the second line (- "./environments/local/data/composer:/home/developer/.composer:rw") all of a sudden it starts seeing the override and works correctly. I don't see any logic in this behavior. Any ideas?

@shin-
Copy link

shin- commented Sep 27, 2017

It's a bug with our merging method. Thank you for reporting it.

In the meantime, you can use the expanded volume notation with the 3.2 format which shouldn't be affected by this issue: https://docs.docker.com/compose/compose-file/#long-syntax-3

@ozmad
Copy link

ozmad commented Aug 19, 2020

I can't tell if I hit this bug but as a workaround (unintentionally) I mapped the volume to a different target file and started the container, then I stopped it, revert the volume mapping to the original one and the problem was fixed.
Voodoo is your friend.

@FelixBenning
Copy link

My overriding docker-compose.yml mounts the entire project folder (devcontainer). My original docker-compose.yml only mounts the configuration folder as ro. When I try to edit configuration files it errors as read-only.

I would have expected that the overriding mount would trump the read-only mount even though it is wider than the config only mount. Is this desired behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants