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

docker run --rm incompatible with restart: always #1218

Closed
wernight opened this issue Mar 30, 2015 · 7 comments
Closed

docker run --rm incompatible with restart: always #1218

wernight opened this issue Mar 30, 2015 · 7 comments

Comments

@wernight
Copy link

Having a docker-compose.yml with restart: always is good for services started by docker up. However when executing commands during a build or during development via docker run --rm ... it'll also restart that container and this command will loop forever.

  • Could allow specifying --restart never for docker run but that's edge.
  • Should ignore restart: during docker-compose run ... commands, only use it for docker-compose start or docker-compose up
  • Could restart linked containers even if they don't have restart: always. This would also fix the issue as one could do:
service:
  links:
    - web
  restart: always
web:
  image: nginx
  links: php
php:
  image: php

Then a docker-compose run --rm php ... would not restart this command, but a docker-compose up service would start and restart all linked services.

@wernight
Copy link
Author

It also affects linked containers. For example:

web:
  image: nginx
test:
  links: php
$ docker-compose run --rm test

Will start but not stop web.

@dnephin
Copy link

dnephin commented Mar 30, 2015

Duplicate of #1013 I think

@wernight
Copy link
Author

Yes looks like almost duplicate but without requiring any docker up -d.

@Neppord
Copy link

Neppord commented Jun 24, 2015

1+

the current behavior is bad and not that intuitive.

@wernight
Copy link
Author

I think it has been fixed in 1.3.

@wernight
Copy link
Author

docker-compose run without --rm should it respect restart: always or
not? I guess you're arguing it should not. I'm finding both solutions valid
and I'm more thinking about issues. If there is a flag --restart=always
for docker-compose run then I'd agree. Without that, there are cases
where it would else remove features.

On Wed, 24 Jun 2015 at 11:30 Samuel Ytterbrink notifications@github.com
wrote:

1+

the current behavior is bad and not that intuitive.


Reply to this email directly or view it on GitHub
#1218 (comment).

@dnephin
Copy link

dnephin commented Jun 29, 2015

this was fixed in #1205

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

No branches or pull requests

3 participants