Skip to content

examples: support both localhost and 127.0.0.1 in Docker examples #4306

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
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Connect to your workspace via SSH:
coder ssh <workspaceName>
```

To access your workspace in the Coder dashboard, navigate to the [configured access URL](./install/configure.md),
To access your workspace in the Coder dashboard, navigate to the [configured access URL](../admin/configure#access-url),
and log in with the owner credentials provided to you by Coder.

![Coder Web UI with code-server](./images/code-server.png)
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-code-server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "docker_container" "workspace" {
hostname = lower(data.coder_workspace.me.name)
dns = ["1.1.1.1"]
# Use the docker gateway if the access URL is 127.0.0.1
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
host {
host = "host.docker.internal"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-image-builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ resource "docker_container" "workspace" {
hostname = lower(data.coder_workspace.me.name)
dns = ["1.1.1.1"]
# Use the docker gateway if the access URL is 127.0.0.1
command = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
command = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
host {
host = "host.docker.internal"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker-with-dotfiles/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "docker_container" "workspace" {
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
dns = ["1.1.1.1"]
# Refer to Docker host when Coder is on localhost
command = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
command = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
host {
host = "host.docker.internal"
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/docker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ resource "docker_container" "workspace" {
"sh", "-c",
<<EOT
trap '[ $? -ne 0 ] && echo === Agent script exited with non-zero code. Sleeping infinitely to preserve logs... && sleep infinity' EXIT
${replace(coder_agent.main.init_script, "localhost", "host.docker.internal")}
${replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")}
EOT
]
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Tooltips/UserRoleHelpTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const UserRoleHelpTooltip: FC = () => {
<HelpTooltipTitle>{Language.title}</HelpTooltipTitle>
<HelpTooltipText>{Language.text}</HelpTooltipText>
<HelpTooltipLinksGroup>
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/users#user-roles">
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/admin/users#roles">
{Language.link}
</HelpTooltipLink>
</HelpTooltipLinksGroup>
Expand Down