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

Ability to only create the container, and not run it #1284

Closed
arun-gupta opened this Issue Apr 12, 2015 · 6 comments

Comments

Projects
None yet
5 participants
@arun-gupta

arun-gupta commented Apr 12, 2015

This would be useful for data-only container.

So something like this would be useful:

mysql-data:
  image: arungupta/mysql-data-container
  create-only: true
mysqldb:
  image: mysql:latest
  volumes-from: mysqld-data
  environment:
    MYSQL_DATABASE: sample
    MYSQL_USER: mysql
    MYSQL_PASSWORD: mysql
    MYSQL_ROOT_PASSWORD: supersecret
@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Apr 13, 2015

Contributor

are you aware that you don't need data-containers if you use compose since defined volumes will persist when you recreate a service?

Contributor

funkyfuture commented Apr 13, 2015

are you aware that you don't need data-containers if you use compose since defined volumes will persist when you recreate a service?

@arun-gupta

This comment has been minimized.

Show comment
Hide comment
@arun-gupta

arun-gupta Apr 13, 2015

Aren't those defined volumes specific to a container only though? And not shareable across containers?

arun-gupta commented Apr 13, 2015

Aren't those defined volumes specific to a container only though? And not shareable across containers?

@ibnesayeed

This comment has been minimized.

Show comment
Hide comment
@ibnesayeed

ibnesayeed Apr 14, 2015

I think it is a good idea to have data container that will allow mounting external storage into specified volumes in one place and rest of the containers can link from the data container and use those volumes. This will also be helpful if you run multiple instances of containers other than data container, in that case individual instances will not try to remount any volumes specified.

On the other hand, I can have a data container that has default command as simple as echo Hello Data, it will execute and exit immediately after printing Hello Data in the log. This will make sure that the image. Although I do think that a create-only: true or spin: false style config will be a plus for other reasons.

ibnesayeed commented Apr 14, 2015

I think it is a good idea to have data container that will allow mounting external storage into specified volumes in one place and rest of the containers can link from the data container and use those volumes. This will also be helpful if you run multiple instances of containers other than data container, in that case individual instances will not try to remount any volumes specified.

On the other hand, I can have a data container that has default command as simple as echo Hello Data, it will execute and exit immediately after printing Hello Data in the log. This will make sure that the image. Although I do think that a create-only: true or spin: false style config will be a plus for other reasons.

@funkyfuture

This comment has been minimized.

Show comment
Hide comment
@funkyfuture

funkyfuture Apr 14, 2015

Contributor

Aren't those defined volumes specific to a container only though? And not shareable across containers?

nope, they can be used them with the volumes_from-key. eg:

web:
  
  volumes:
    - /uploads
    - /home/foo/config:/config

backup:
  
  volumes_from:
    - web

@ibnesayeed with the extend-key you can use a dumb container without havin to repeat the main ingredients and just declare the volumes in question.

Contributor

funkyfuture commented Apr 14, 2015

Aren't those defined volumes specific to a container only though? And not shareable across containers?

nope, they can be used them with the volumes_from-key. eg:

web:
  
  volumes:
    - /uploads
    - /home/foo/config:/config

backup:
  
  volumes_from:
    - web

@ibnesayeed with the extend-key you can use a dumb container without havin to repeat the main ingredients and just declare the volumes in question.

@kojiromike

This comment has been minimized.

Show comment
Hide comment
@kojiromike

kojiromike Apr 29, 2015

Contributor

Is this a duplicate of #942?

Contributor

kojiromike commented Apr 29, 2015

Is this a duplicate of #942?

@dnephin

This comment has been minimized.

Show comment
Hide comment
@dnephin

dnephin May 24, 2015

Contributor

Yes, closing as a duplicate of #942

You can use command: true and docker-compose up -d if you have data volume containers.

Contributor

dnephin commented May 24, 2015

Yes, closing as a duplicate of #942

You can use command: true and docker-compose up -d if you have data volume containers.

@dnephin dnephin closed this May 24, 2015

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