Unable to create docker

This is error log:
Initializing provider plugins...
- Finding latest version of coder/coder...
- Finding latest version of kreuzwerker/docker...
- Installing kreuzwerker/docker v3.0.2...
- Installed kreuzwerker/docker v3.0.2 (self-signed, key ID ...)
- Installing coder/coder v0.21.0...
- Installed coder/coder v0.21.0 (signed by a HashiCorp partner, key ID ....)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider selections it made above. Include this file in your version control repository so that Terraform can guarantee to make the same selections by default when you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary. Terraform data.coder_provisioner.me: Refreshing...06:33:39.512data.coder_workspace.me: Refreshing...06:33:39.516data.coder_workspace.me: Refresh complete after 0s [id=]data.coder_provisioner.me: Refresh complete after 0s [id=]coder_agent.main: Plan to create06:33:39.542coder_app.code-server: Plan to create06:33:39.542Plan: 2 to add, 0 to change, 0 to destroy.06:33:39.548Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied06:33:39.548on main.tf line 19, in provider "docker":06:33:39.548 19: provider "docker" {
Initializing provider plugins...
- Finding latest version of coder/coder...
- Finding latest version of kreuzwerker/docker...
- Installing kreuzwerker/docker v3.0.2...
- Installed kreuzwerker/docker v3.0.2 (self-signed, key ID ...)
- Installing coder/coder v0.21.0...
- Installed coder/coder v0.21.0 (signed by a HashiCorp partner, key ID ....)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider selections it made above. Include this file in your version control repository so that Terraform can guarantee to make the same selections by default when you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary. Terraform data.coder_provisioner.me: Refreshing...06:33:39.512data.coder_workspace.me: Refreshing...06:33:39.516data.coder_workspace.me: Refresh complete after 0s [id=]data.coder_provisioner.me: Refresh complete after 0s [id=]coder_agent.main: Plan to create06:33:39.542coder_app.code-server: Plan to create06:33:39.542Plan: 2 to add, 0 to change, 0 to destroy.06:33:39.548Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied06:33:39.548on main.tf line 19, in provider "docker":06:33:39.548 19: provider "docker" {
Solution:
in both cases you need to add the coder user to the docker group. https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user...
Docker Documentation
Linux post-installation steps for Docker Engine
Find the recommended Docker Engine post-installation steps for Linux users, including how to run Docker as a non-root user and more.
Jump to solution
9 Replies
Codercord
Codercord8mo ago
<#1232114567497256992>
Category
Other
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Trung™
Trung™OP8mo ago
IDs are hidden Ok Also Error: Post "http://localhost/api/v1/namespaces/devtrung/persistentvolumeclaims": dial tcp [::1]:80: connect: connection refused on main.tf line 190, in resource "kubernetes_persistent_volume_claim" "home": 190: resource "kubernetes_persistent_volume_claim" "home" {
Atif
Atif8mo ago
How is Coder installed and running? To use the docker template, the user is running the Coder service, or, in the case of docker-compose/Kubernetes, the coder user inside the coder container needs access to the docker socket. For the Kubernetes template, you need a k8s cluster and the template configured to be able to use the provided KUBECONFIG file
Atif
Atif8mo ago
See the prerequisites for each template. https://registry.coder.com/templates/nomad-docker?tab=readme
Nomad - Coder Registry
Provision Nomad Jobs as Coder workspaces
Trung™
Trung™OP8mo ago
Installed by curl And running How to add coder to docker socket? Uh
Atif
Atif8mo ago
Are you running coder as a system service? OR via CLI coder server
Solution
Atif
Atif8mo ago
in both cases you need to add the coder user to the docker group. https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
Docker Documentation
Linux post-installation steps for Docker Engine
Find the recommended Docker Engine post-installation steps for Linux users, including how to run Docker as a non-root user and more.
Trung™
Trung™OP8mo ago
I am running system service Systemctl Thanks It works
Codercord
Codercord8mo ago
@Atif closed the thread.
Want results from more Discord servers?
Add your server