DnD (Docker inside Docker)
41
This is a custom Ubuntu image that includes Docker and some Docker images. Here's how you can use it:
If you only want to work inside the container:
docker run -p 3004:3004 --privileged -it my-custom-ubuntu-image
For volume mapping, follow these steps:
docker run -p 3004:3004 --privileged -it -v /c/volume-map:/home/volume my-custom-ubuntu-image
If you're using a Windows host, create a 'volume-map' folder directly on the C drive. After executing the above command beside the 'volume-map' folder you will see a folder that looks like "volume-map;C." Any changes made in this folder will reflect inside the Ubuntu container's volume folder.
Create a 'static-html' folder inside the 'volume-map;C' directory on your Windows machine. This folder should contain files like 'app.html' and 'index.html,' which you can edit from the host machine.
Run the Nginx container with the following command:
docker run -p 3004:80 -v '/\Program Files\Git\home\html:/usr/share/nginx/html' nginx
** This setup allows you to access 'localhost:3004/app.html' from your host machine and see the edited 'app.html' file from the custom Ubuntu Docker container. **
docker commit <container_id> my-custom-ubuntu-image
Content type
Image
Digest
sha256:10fddd062…
Size
1.8 GB
Last updated
about 3 years ago
docker pull jsiqbal/my-custom-ubuntu-image:v1