Docker Dind Volume Issue
Hey team
I’m struggling to build the following setup
I have my Linux virtual machine running on Azure acting as a coder host
And I have the default docker template that you provide
I’m creating an workspace and installing docker inside of it
Inside the workspace I’m cloning my git repo that includes an docker-compose that setups my project using VOLUMES
But when I run the docker compose and I exec inside the containers, the files are actually directories, I spent some hours googling it and it seems that this is related to the docker inside my workspace actually using my host docker sock ( kind weird but I think that’s it ) and because of that docker is not able to really find the git clonned repo to be used as a volume
Do you know how fix this? Or if can I use a different approach?
I really need to use the docker-compose with volumes because because I need to use the hot reload feature to improve my experience
24 Replies
<#1120502779639762956>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
I'd recommend using sysbox with Coder to allow your Docker containers to run Docker.
https://coder.com/docs/v2/latest/templates/docker-in-workspaces#use-sysbox-in-docker-based-templates
Docker in Workspaces - Coder v2 Docs
Use docker inside containerized templates
Hey @Marco Aleixo, did you managed to find a solution for your problem? I facing the same issues.
@nelsonsilva Have you explored using the sysbox-runc?
more details in the link Kyle shared above
Try and update and I will be happy to help
I was not able to put sysbox-runc working, I got it working only with a privileged sidecar container (https://coder.com/docs/v2/latest/templates/docker-in-workspaces#privileged-sidecar-container) which I understand is not optimal.
Docker in workspaces - Coder v2 Docs
Use Docker inside containerized templates
It should be two steps.
1. Install sysbox-runc
2. Update template to to use sysbox-runc as the docker runtime
It should not require a privileged container
Where should I install sysbox-runc? On the host or on the docker container which I am running coder?
I use docker-compose to set up coder, like the docs specifies (https://coder.com/docs/v2/latest/install/docker#requirements)
Docker - Coder v2 Docs
Install Coder with Docker / docker-compose
In a selfhosted server
sysbox-runc should be installed on the docker host(s) where your workspaces will be provisioned.
Sorry but I am still not sure where to install it. Now, I set coder up using the docker-compose file and I am mounting the docker socket to the container. I am not allowed to install sysbox-runc on the host machine because we have another projects that need another runtime engine.
So, do I have to install it on the docker container where I have coder or on my host machine?
It should be on host machine in this case
as you are mounting the host docker socker within the coder container
So Coder will provision all workspaces on the Host
Can I not mount the docker socket volume and then install sysbox on the container?
Installing sysbox-runc adds sysboc-runc as an additional option for the runtime
and other projects can still use other runtimes
Ahh ok, I see
Thanks, then I try it out