-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Docker compose not using external named volume on Mac #5012
Comments
Can you try upgrading Compose to the latest (1.14.0) version and check if the problem persists? |
@shin- Yes it is still persists in |
I'm unable to reproduce this locally. Are you sure that volume is created by Compose? They're usually given human-readable names, like |
@shin- Yes the volume is created by compose only. Moreover it is not giving human-readable names like you specified. As you said I would raise this issue on |
Here are the detail log details when I do
Since I provided external |
demo_db_1 is the DB's container, it should absolutely be created. Can you try running |
As you can see in those logs,
There is no reasonable indication that this volume you're seeing is being created or used by Compose. |
Right, I see the issue now. The Dockerfile for the official postgres image already defines an anonymous volume on that container path, which conflicts with the one you're declaring yourself. The way I would go about it is use the version: '3'
services:
db:
image: postgres
environment:
PGDATA: /var/postgres_data
volumes:
- data:/var/postgres_data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- db
volumes:
data:
external: true The other alternative would be to build your own |
@shin- Still it creates anonymous volume on FYI, in my |
I'm testing this on Linux - I can verify that the anonymous volume is created there as well. It doesn't matter as long as you're not storing any data in it (setting PGDATA to a different directory ensures that). Still, if you're that worried, just build your own
Doesn't matter - it's the path inside the container, and it will be created regardless. |
I have the same problem - added my inspect-output in docker/for-mac#1856 |
@shin- It doesn't help if you are testing on Linux - I'm sure it works on Linux. On Mac Docker runs in it's own VM. I think this config is responsible for the problem. |
I have created a volume with options as
docker volume create --name=data
. Then I rundocker-compose up
which creates a volume apart fromdata
as shown below.docker version is
17.03.1-ce, build c6d412e
and docker compose version is1.11.2, build dfed245
.OSX version is
10.12.5
Could you let me know what went wrong?
The text was updated successfully, but these errors were encountered: