Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Nov 8, 2022

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

@mafredri mafredri self-assigned this Nov 8, 2022
@mafredri mafredri requested a review from a team November 8, 2022 14:41
@mafredri mafredri force-pushed the mafredri/cleanup-docker-templates branch from 4a34a91 to b32fdb2 Compare November 8, 2022 14:43
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
@mafredri mafredri force-pushed the mafredri/cleanup-docker-templates branch from b32fdb2 to 4e79a9c Compare November 8, 2022 14:44
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mafredri mafredri requested review from ammario and bpmct November 8, 2022 14:45
Copy link
Member

@ammario ammario left a 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")]
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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.

@mafredri mafredri merged commit b2a16d4 into main Nov 8, 2022
@mafredri mafredri deleted the mafredri/cleanup-docker-templates branch November 8, 2022 16:52
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants