Sign inSign up

jsiqbal/my-custom-ubuntu-image

By jsiqbal

•Updated about 3 years ago

DnD (Docker inside Docker)

Image
0

41

jsiqbal/my-custom-ubuntu-image repository overview

⁠Custom Ubuntu Docker Image with Docker Inside

This is a custom Ubuntu image that includes Docker and some Docker images. Here's how you can use it:

⁠Basic Usage

If you only want to work inside the container:

docker run -p 3004:3004 --privileged -it my-custom-ubuntu-image
⁠Volume Mapping

For volume mapping, follow these steps:

  • Run the container with volume mapping:
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.

⁠Manipulating Nginx Inside the Ubuntu Container

⁠Suppose you want to manipulate the Nginx running inside the Ubuntu container:
  • 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. **

  • To keep the changes made in your container:
docker commit <container_id> my-custom-ubuntu-image

Tag summary

Content type

Image

Digest

sha256:10fddd062…

Size

1.8 GB

Last updated

about 3 years ago

docker pull jsiqbal/my-custom-ubuntu-image:v1