maybe it's a stupid question but, i would like to know how can i bring the data,folders and code FROM my container in MY desktop to work with my IDE with docker-compose, is it possible?
Thank you in advance to everyone!
maybe it's a stupid question but, i would like to know how can i bring the data,folders and code FROM my container in MY desktop to work with my IDE with docker-compose, is it possible?
Thank you in advance to everyone!
You can access data inside your container from your local machine using docker volume.
Run your container with binding docker volume with your local file system like this:
docker run --name=<name> -d -v <local_directory>:<directory_inside_container> <image>
for instance, you have nginx container and you want to access container logs on local, you can do something like this:
docker run --name=nginx -d -v ~/nginxlogs:/var/log/nginx -p 5000:80 nginx
where ~/nginxlogs
is directory on your local, while /var/log/nginx
is the directory inside container.
Now you can access container logs in nginxlogs
directory on local.
For docker-compose.yml
add volume tag like this:
volumes:
- ~/nginxlogs:/var/log/nginx