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
<#1204025709966921780>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Try using
$pwd
in place of .
same issue, it loads the current directory but of the host, not the current path inside the workspace container
Aren't you running this docker compose file from within the workspace?
Then it should translate to your current directory within your workspace
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.
Oh so you are running docker in docker by mounting the host docker socket within the container?
@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.
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
Try this
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 @nelsonsilva, did you figure this out ?
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.