mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +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>
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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}"]
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user