-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 Provider Does Not Support --restart Switch #2417
Comments
This is a major requirement for me as well, I am currently trying to roll out a Terraform controlled docker container cluster and without |
Some docs on this, in case others who are as Docker-clueless as me find this issue: 😁 Looks like this is exposed as a Here is where Terraform builds the
Here is where the valid attributes for the Docker container resource are defined:
Looks like this should be a reasonably simple change to add: just add a @supernomad if you're interested I think this could be a good change with which to get started with Terraform development, since it's includes the most common pattern in Terraform provider development: marshalling values from the Terraform config into a provider-specific client. No pressure, of course! Even though in the Docker API there is a sub-structure for the name and maximum retry count, I think I'd be tempted to flatten them both as top-level properties so that it's simpler in the "no" and "always" cases, since the other value is only used in the "on-failure" case. But I'm far from a Docker expert, so I'll cede to someone who has a better sense of what's intuitive to Docker users. |
@apparentlymart I will give it a shot sometime this weekend and will post a PR as soon as possible. Is there any guidelines I should follow to match code quality? |
Another related PR: #3761 |
provider/docker: #2417 Add support for restart policy unless-stopped
Merged in #3761 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm using v0.5.3 to control some Docker containers and I've run into an issue: the Docker provider does not provide an equivalent to
--restart=yes
of thedocker run
command. The upshot is that when the Docker host is restarted, your containers are inactive. This is unacceptable for the majority of containers I run -- databases and message brokers. I need those containers alive and kicking if the box gets rebooted.The text was updated successfully, but these errors were encountered: