-
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
provider/docker: Add extra_hosts parameter for containers #3463
Conversation
@@ -101,6 +101,14 @@ func resourceDockerContainer() *schema.Resource { | |||
Set: resourceDockerPortsHash, | |||
}, | |||
|
|||
"extra_hosts": &schema.Schema{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a set, it's valid to have multiple instances of it. Might this be better named extra_host
(singular) or even host
such that the set semantics read better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more in favour of hosts
, so that it matches ports
and volumes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for consistency.
Hi @paulbellamy! Thanks for submitting this. I've left a few comments in line, could you let me know your thoughts on them? |
Hi @paulbellamy! I've replied to your comments inline. I merged quite a bit into the docker container resource today, so if you could rebase your work onto |
2bc20f6
to
52d178b
Compare
Cool, applied changes and rebased. I also inlined |
Thanks @paulbellamy! I pulled this locally and added some acceptance tests. The only other change I made was to rename |
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. |
Usage, as in:
It's equivalent to the docker command-line
--add-host host:ip
flag, but I've opted for the docker API version (calledExtraHosts
), as I feel it works better syntactically.