C
Coder.com9mo ago
Marc

Docker in Docker docker-compose volume

Hi, I have a Docker in Docker setup with a git repo inside that has a docker-compose.yml. One of the containers has a volume that maps the current folder to a folder inside the container. The issue is that using a Docker in Docker setup, the current folder "." is mapped to the host (which not exists), not the current workspace container. volumes: - '.:/var/www/html' How I can map the current folder (as it would work in a local/host setup)? Thanks.
11 Replies
Codercord
Codercord9mo ago
<#1204025709966921780>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Atif
Atif9mo ago
Try using $pwd in place of .
Marc
Marc9mo ago
same issue, it loads the current directory but of the host, not the current path inside the workspace container
Atif
Atif9mo ago
Aren't you running this docker compose file from within the workspace? Then it should translate to your current directory within your workspace
Marc
Marc9mo ago
I'm running docker compose within the workspace. The issue happens because when using docker in docker, the inner container (workspace) uses the host docker socket when running docker command in it.
Atif
Atif9mo ago
Oh so you are running docker in docker by mounting the host docker socket within the container?
nelsonsilva
nelsonsilva8mo ago
@Marc do you find any solution for your problem? I am facing the same problem, I must run a docker compose inside my docker workspace and I am having issues with the volumes. Any help is appreciated, thanks in advance. @Atif any sugestion on how to run a docker compose inside a docker workspace? My coder installation is via Docker compose.
Atif
Atif8mo ago
Please check https://coder.com/docs/v2/latest/templates/docker-in-workspaces for some possible ways to run docker within workspaces
Docker in workspaces - Coder v2 Docs
Use Docker inside containerized templates
Phorcys
Phorcys7mo ago
hey @nelsonsilva, did you figure this out ?
nelsonsilva
nelsonsilva7mo ago
Unfortunately no, I had to pause my coder setup development because of company priorities. I will write back as soon as I have news about it. Thanks for asking.
Want results from more Discord servers?
Add your server