mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
examples: support both localhost and 127.0.0.1 in Docker examples (#4306)
And some minor fixes
This commit is contained in:
@ -44,7 +44,7 @@ Connect to your workspace via SSH:
|
|||||||
coder ssh <workspaceName>
|
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.
|
and log in with the owner credentials provided to you by Coder.
|
||||||
|
|
||||||

|

|
||||||
|
@ -61,7 +61,7 @@ resource "docker_container" "workspace" {
|
|||||||
hostname = lower(data.coder_workspace.me.name)
|
hostname = lower(data.coder_workspace.me.name)
|
||||||
dns = ["1.1.1.1"]
|
dns = ["1.1.1.1"]
|
||||||
# Use the docker gateway if the access URL is 127.0.0.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}"]
|
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
|
||||||
host {
|
host {
|
||||||
host = "host.docker.internal"
|
host = "host.docker.internal"
|
||||||
|
@ -90,7 +90,7 @@ resource "docker_container" "workspace" {
|
|||||||
hostname = lower(data.coder_workspace.me.name)
|
hostname = lower(data.coder_workspace.me.name)
|
||||||
dns = ["1.1.1.1"]
|
dns = ["1.1.1.1"]
|
||||||
# Use the docker gateway if the access URL is 127.0.0.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}"]
|
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
|
||||||
host {
|
host {
|
||||||
host = "host.docker.internal"
|
host = "host.docker.internal"
|
||||||
|
@ -57,7 +57,7 @@ resource "docker_container" "workspace" {
|
|||||||
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
|
name = "coder-${data.coder_workspace.me.owner}-${lower(data.coder_workspace.me.name)}"
|
||||||
dns = ["1.1.1.1"]
|
dns = ["1.1.1.1"]
|
||||||
# Refer to Docker host when Coder is on localhost
|
# 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}"]
|
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
|
||||||
host {
|
host {
|
||||||
host = "host.docker.internal"
|
host = "host.docker.internal"
|
||||||
|
@ -83,7 +83,7 @@ resource "docker_container" "workspace" {
|
|||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
<<EOT
|
<<EOT
|
||||||
trap '[ $? -ne 0 ] && echo === Agent script exited with non-zero code. Sleeping infinitely to preserve logs... && sleep infinity' EXIT
|
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
|
EOT
|
||||||
]
|
]
|
||||||
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
|
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"]
|
||||||
|
@ -21,7 +21,7 @@ export const UserRoleHelpTooltip: FC = () => {
|
|||||||
<HelpTooltipTitle>{Language.title}</HelpTooltipTitle>
|
<HelpTooltipTitle>{Language.title}</HelpTooltipTitle>
|
||||||
<HelpTooltipText>{Language.text}</HelpTooltipText>
|
<HelpTooltipText>{Language.text}</HelpTooltipText>
|
||||||
<HelpTooltipLinksGroup>
|
<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}
|
{Language.link}
|
||||||
</HelpTooltipLink>
|
</HelpTooltipLink>
|
||||||
</HelpTooltipLinksGroup>
|
</HelpTooltipLinksGroup>
|
||||||
|
Reference in New Issue
Block a user