docker-py
docker-py copied to clipboard
adding unless-stopped to the restart_policy option documentation
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
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" [email protected]: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.
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.