-
Notifications
You must be signed in to change notification settings - Fork 900
chore: Unify Docker terraform templates #4952
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
Conversation
4a34a91
to
b32fdb2
Compare
Changes to terraform templates: * Remove DNS (this can interfere with users running their own DNS servers) * Remove `lower()` restriction from hostnames so that it will show the name set by the user, as-is (there is no restriction on upper case letters in hostnames) * Remove superfluous `trap` in entrypoints, this is already handled by the init script * Switch from `command` to `entrypoint` as the latter can support more Docker images out-of-the-box
b32fdb2
to
4e79a9c
Compare
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.
LGTM
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.
Nice simplification
EOT | ||
] | ||
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"] | ||
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")] |
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 think we can replace these with the new 'provider.url' attribute.
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.
@ammario we can't. I never merged the change to adjust the hostname.
The primary problem was if you were using the tunnel, because the access URL would be https://<url>:443
. If we just adjusted the hostname, then host.docker.internal:443
would be dialed.
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.
Ah that would indeed have been neat. I guess we’ll keep it like this for now.
Changes to terraform templates:
servers)
lower()
restriction from hostnames so that it will show thename set by the user, as-is (there is no restriction on upper case
letters in hostnames)
trap
in entrypoints, this is already handled bythe init script
command
toentrypoint
as the latter can support moreDocker images out-of-the-box