From 78a39a809d771957725f976fc8bd08908d7f9409 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Mon, 3 Oct 2022 08:31:12 -0500 Subject: [PATCH] examples: support both localhost and 127.0.0.1 in Docker examples (#4306) And some minor fixes --- docs/quickstart.md | 2 +- examples/templates/docker-code-server/main.tf | 2 +- examples/templates/docker-image-builds/main.tf | 2 +- examples/templates/docker-with-dotfiles/main.tf | 2 +- examples/templates/docker/main.tf | 2 +- site/src/components/Tooltips/UserRoleHelpTooltip.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index 40c0de3984..ed59929380 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -44,7 +44,7 @@ Connect to your workspace via SSH: coder ssh ``` -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) diff --git a/examples/templates/docker-code-server/main.tf b/examples/templates/docker-code-server/main.tf index 1c16784a9c..242d0eb956 100644 --- a/examples/templates/docker-code-server/main.tf +++ b/examples/templates/docker-code-server/main.tf @@ -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" diff --git a/examples/templates/docker-image-builds/main.tf b/examples/templates/docker-image-builds/main.tf index 556e1f2a21..fdfad1f104 100644 --- a/examples/templates/docker-image-builds/main.tf +++ b/examples/templates/docker-image-builds/main.tf @@ -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" diff --git a/examples/templates/docker-with-dotfiles/main.tf b/examples/templates/docker-with-dotfiles/main.tf index 594cdb72d3..6d9e76195b 100644 --- a/examples/templates/docker-with-dotfiles/main.tf +++ b/examples/templates/docker-with-dotfiles/main.tf @@ -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" diff --git a/examples/templates/docker/main.tf b/examples/templates/docker/main.tf index bace09af9b..b690a00223 100644 --- a/examples/templates/docker/main.tf +++ b/examples/templates/docker/main.tf @@ -83,7 +83,7 @@ resource "docker_container" "workspace" { "sh", "-c", < { {Language.title} {Language.text} - + {Language.link}