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

Add option to support updating image on start/restart #16

Open
DrewBarrett opened this issue Jul 12, 2019 · 2 comments
Open

Add option to support updating image on start/restart #16

DrewBarrett opened this issue Jul 12, 2019 · 2 comments

Comments

@DrewBarrett
Copy link

Basically I'm proposing to add a flag that changes the unit file to contain

TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill image
ExecStartPre=-/usr/bin/docker rm image
ExecStartPre=/usr/bin/docker pull user/image

as opposed to the current

ExecStartPre=-{{ docker_path }} rm -f {{ container_name }}

I'm going to implement this for my own use, so let me know if you'd like me to submit a pull request.

@mhutter mhutter self-assigned this Aug 5, 2019
@mhutter
Copy link
Owner

mhutter commented Aug 5, 2019

What's the purpose behind this change? The point of docker rm CONTAINERname is to avoid conflicts when running docker run.

To update the image before (re)starting, only ExecStartPre=/usr/bin/docker pull user/image is required.

@DrewBarrett
Copy link
Author

Yeah that was just an extra verbose example (and rm image was a typo for rm containername. I believe TimeoutStartSec=0 is also needed in the case of large images so it does not hit the default systemd timeout

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

2 participants