Skip to content

Add a variable to ask for socket in Docker-based example templates #15035

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
phorcys420 opened this issue Oct 10, 2024 · 2 comments · Fixed by #15049
Closed

Add a variable to ask for socket in Docker-based example templates #15035

phorcys420 opened this issue Oct 10, 2024 · 2 comments · Fixed by #15049
Assignees

Comments

@phorcys420
Copy link
Member

When adding one of the Docker-based starter templates (from/starter-templates) while using an external Docker daemon that does not match the Docker provider's default value (/var/run/docker.sock), you will be met by an error message telling you that the Docker socket can't be reached.

This also means that the template won't be added to your instance due to the error, and you can't just change that, so you need to clone and edit the example from the repo, and then push it to your Coder instance.

I think we can fix this pretty easily by just adding a variable block asking for the socket's path.

cc: @matifali

@phorcys420 phorcys420 self-assigned this Oct 10, 2024
@coder-labeler coder-labeler bot added feature need-help Assign this label prompts an engineer to check the issue. Only humans may set this. labels Oct 10, 2024
@phorcys420
Copy link
Member Author

This is what will happen if you try to create a template from the Docker-based starter templates when you don't have a Docker socket, and then you're just stuck.

Error: Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
on main.tf line 19, in provider "docker":
  19: provider "docker" {

Image

@matifali
Copy link
Member

This was previously discussed in #6860 (comment), but it ended in that we still need a valid default value for the docker socket; otherwise, the docker provider refuses to initialize in the planning phase.
I am open to making it a template variable if that solves the issue.

@matifali matifali removed the need-help Assign this label prompts an engineer to check the issue. Only humans may set this. label Oct 10, 2024
@matifali matifali changed the title fix: add a variable to ask for socket in Docker-based example templates Add a variable to ask for socket in Docker-based example templates Oct 11, 2024
phorcys420 added a commit that referenced this issue Oct 12, 2024
phorcys420 added a commit that referenced this issue Oct 12, 2024
#15035) (#15049)

This PR fixes #15035, I have tested it on my instance and it works as
expected.
@matifali matifali removed the feature label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants