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

Specify volume name so it's not created as a hash #14

Open
digitalpenguin opened this issue Dec 20, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@digitalpenguin
Copy link

commented Dec 20, 2016

Currently the working directory on the host machine is created with a hash because the volume name isn't specified in the docker-compose.yml file.

Also being able to choose where the volume is mounted on the host would be great. Currently everything goes into /var/lib/docker

https://docs.docker.com/compose/compose-file/#volume-configuration-reference

@digitalpenguin

This comment has been minimized.

Copy link
Author

commented Dec 24, 2016

It appears that version 2 of the docker-compose.yml file is required to be able to name volumes.
I'm also trying to get the mounted volume out of /var/lib/docker and into my /home dir so I can easily edit the files on the host.
So far I have:

version: '2'

services:
    web:
      image: modx
      volumes: 
        - html:/home/digitalpenguin/dev/modxdev
      links:
        - db:mysql
      ports:
        - 80:80
    db:
      image: mysql
      environment:
        MYSQL_ROOT_PASSWORD: example
      ports:
        - 3306:3306
      command: mysqld --sql-mode=NO_ENGINE_SUBSTITUTION
    myadmin:
      image: phpmyadmin/phpmyadmin
      links:
        - db:db
      ports:
        - 8080:8080
        
volumes:
    html:
        external: false

But unfortunately this causes the docker_web_1 container to exit as soon as it's created. Any idea what might be the problem with this syntax?

@digitalpenguin

This comment has been minimized.

Copy link
Author

commented Dec 27, 2016

Here's a reference to the stackoverflow post I've been getting help with.
http://stackoverflow.com/questions/41303760/how-to-name-a-volume-using-a-docker-compose-yml-file

If specifying a volume, it seems the web container can't find the db container. A problem in the entrypoint script perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.