C
Coder.com10mo 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
Codercord10mo ago
<#1204025709966921780>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Atif
Atif10mo ago
Try using $pwd in place of .
Marc
MarcOP10mo ago
same issue, it loads the current directory but of the host, not the current path inside the workspace container
Atif
Atif10mo 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
MarcOP10mo 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
Atif10mo ago
Oh so you are running docker in docker by mounting the host docker socket within the container?
nelsonsilva
nelsonsilva9mo 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
Atif9mo 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
Phorcys8mo ago
hey @nelsonsilva, did you figure this out ?
nelsonsilva
nelsonsilva8mo 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