Skip to content

Commit 78a39a8

Browse files
authored
examples: support both localhost and 127.0.0.1 in Docker examples (#4306)
And some minor fixes
1 parent 092a22f commit 78a39a8

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

docs/quickstart.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Connect to your workspace via SSH:
4444
coder ssh <workspaceName>
4545
```
4646

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

5050
![Coder Web UI with code-server](./images/code-server.png)

examples/templates/docker-code-server/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ resource "docker_container" "workspace" {
6161
hostname = lower(data.coder_workspace.me.name)
6262
dns = ["1.1.1.1"]
6363
# Use the docker gateway if the access URL is 127.0.0.1
64-
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
64+
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
6565
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
6666
host {
6767
host = "host.docker.internal"

examples/templates/docker-image-builds/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ resource "docker_container" "workspace" {
9090
hostname = lower(data.coder_workspace.me.name)
9191
dns = ["1.1.1.1"]
9292
# Use the docker gateway if the access URL is 127.0.0.1
93-
command = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
93+
command = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
9494
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
9595
host {
9696
host = "host.docker.internal"

examples/templates/docker-with-dotfiles/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ resource "docker_container" "workspace" {
5757
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
5858
dns = ["1.1.1.1"]
5959
# Refer to Docker host when Coder is on localhost
60-
command = ["sh", "-c", replace(coder_agent.main.init_script, "127.0.0.1", "host.docker.internal")]
60+
command = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")]
6161
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
6262
host {
6363
host = "host.docker.internal"

examples/templates/docker/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ resource "docker_container" "workspace" {
8383
"sh", "-c",
8484
<<EOT
8585
trap '[ $? -ne 0 ] && echo === Agent script exited with non-zero code. Sleeping infinitely to preserve logs... && sleep infinity' EXIT
86-
${replace(coder_agent.main.init_script, "localhost", "host.docker.internal")}
86+
${replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")}
8787
EOT
8888
]
8989
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]

site/src/components/Tooltips/UserRoleHelpTooltip.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const UserRoleHelpTooltip: FC = () => {
2121
<HelpTooltipTitle>{Language.title}</HelpTooltipTitle>
2222
<HelpTooltipText>{Language.text}</HelpTooltipText>
2323
<HelpTooltipLinksGroup>
24-
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/users#user-roles">
24+
<HelpTooltipLink href="https://coder.com/docs/coder-oss/latest/admin/users#roles">
2525
{Language.link}
2626
</HelpTooltipLink>
2727
</HelpTooltipLinksGroup>

0 commit comments

Comments
 (0)