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

adding unless-stopped to the restart_policy option documentation #2312

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

naorlivne
Copy link

@naorlivne naorlivne commented Apr 15, 2019

According to https://docs.docker.com/config/containers/start-containers-automatically/ there is also an option of using unless-stopped as one of Docker restart policies, this seems to be not an option with docker-py as it's missing from the documentation where in fact it does work (yay) but simply is not mentioned in docker-py documentation.

This pull request adds the missing unless-stopped as a viable option in the documentation of restart_policy, I confirmed it to be a missing documentation only issue by using the low level API to create a container with a restart_policy with a value of {'Name': 'unless-stopped'} then using docker inspect to verify it indeed started the container with the configuration of

...
"RestartPolicy": {
                "Name": "unless-stopped",
                "MaximumRetryCount": 0
            },
...

Which matches the expected configuration of such a restart policy & that of a another container which was started using the following Docker CLI command docker run --name test --restart unless-stopped nginx

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" git@github.com:naorlivne/docker-py.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Naor Livne <naorlivne@gmail.com>
Signed-off-by: Naor Livne <naor@mintigo.com>
@naorlivne
Copy link
Author

naorlivne commented Apr 15, 2019

Is everything alright with the Jenkins builds?

it fails on SwarmTest.test_init_swarm_with_ca_config with an error of docker.errors.APIError: 503 Server Error: Service Unavailable ("Swarm is encrypted and needs to be unlocked before it can be used. Please use "docker swarm unlock" to unlock it.") which has noting to do with the changes of this pull requests (which are all documentation changes).

Running make test locally results with them passing which furthers strengths my assumption that there is an issue with Jenkins.

naorlivne added 2 commits June 20, 2019 17:57
Signed-off-by: Naor Livne <naor@mintigo.com>
Signed-off-by: Naor Livne <naor@mintigo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants