Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: remove docker host from docker-compose#1596

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bpmct merged 3 commits intomainfrombpmct/docker-vars
May 19, 2022
Merged

Conversation

bpmct
Copy link
Member

@bpmctbpmct commentedMay 19, 2022
edited
Loading

There isn't really a great solution to get docker-compose working locally:

  • ❌ use 127.0.0.1 as access URL for docker

    • containers dial themselves instead of the Coder control panel
  • ❌ use--network=host on containers in the template

    • no network isolation for workspaces. two workspaces can't have apps on:8080
  • ❌ add host.docker.internal to docker-compose:

    • wrong URL oncoder server command
    Screen Shot 2022-05-19 at 12 18 48 PM
  • ❌ add host.docker.internal to the Docker templates.

  • 🤔 admin parameter for access URL in Docker templates

    • only relevant if running on localhost
  • ✅ this hack (override and replace localhost access URL in Docker start script)

@bpmctbpmct requested a review fromjohnstcnMay 19, 2022 17:20
Comment on lines +84 to +86
# Use the docker gateway if the access URL is 127.0.0.1
command=["sh","-c",replace(coder_agent.dev.init_script,"127.0.0.1","host.docker.internal")]
env=["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@kylecarbs@johnstcn This feels hacky, but seems to address all scenarios:

  • ✅ Proper access URL (https://127.0.0.1:7080) oncoder server "welcome" message
  • ✅ docker-compose examplejust works with Docker examples
  • ✅ Non docker-compose deployments with a proper access URL remain working with the Docker example (no hardcoded values)

@bpmctbpmct requested a review fromkylecarbsMay 19, 2022 19:42
Copy link
Member

@EmyrkEmyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think this is too bad. 👍

command=["sh","-c",coder_agent.dev.init_script]
env=["CODER_AGENT_TOKEN=${coder_agent.dev.token}"]
# Use the docker gateway if the access URL is 127.0.0.1
command=["sh","-c",replace(coder_agent.dev.init_script,"127.0.0.1","host.docker.internal")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice!

@bpmctbpmctenabled auto-merge (squash)May 19, 2022 20:14
@bpmctbpmct merged commit4afc66f intomainMay 19, 2022
@bpmctbpmct deleted the bpmct/docker-vars branchMay 19, 2022 20:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@EmyrkEmyrkEmyrk approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@bpmct@johnstcn@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp