NobleMajo / ubuntudind

Ubuntu Docker in Docker - a ubuntu 24.04 docker in docker image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ubuntudind

Docker CI/CD MIT

table of contents

about

| Docker Hub | GitHub |
The main focus of this project is to provide a ubuntu image with functional docker deamon. You can use this image to run docker containers in a ubuntu container.

This container needs the '--privileged' flag to run! This gives extended privileges to this container.

example commands

pull image

docker push noblemajo/ubuntudind

Own docker sock

Start the container as self hosting docker instance:

docker run -d --privileged \
    --restart unless-stopped \
    --name ubuntudind \
    --network host \
    noblemajo/ubuntudind

Host sock

You can also mount the host docker socket into the container:

docker run -it --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    noblemajo/ubuntudind \
        docker ps

Exec commands

docker exec -it ubuntudind \
    docker ps

Nginx example

docker exec -it ubuntudind \
    docker run -it --rm \
    --name test-nginx \
    -p 8080:80 \
    nginx

Don't forget to remove it:

docker rm -f ubuntudind

Persistent data

The container data need to be mounted for persistency:

docker run -d --privileged \
    --restart unless-stopped \
    --name ubuntudind \
    --network host \
    -v $(pwd)/.store:/var/lib/docker \
    noblemajo/ubuntudind

Control Scripts

This control scripts should help you to understand how to use the image and container.

  • build.sh - build docker image
  • enter.sh - run a container with bash as entrypoint for image testing and debugging purposes
  • start.sh - run docker "test" container with network, volume and backup/cache mount to "./.store"
  • remove.sh - remove docker "test" container
  • exec.sh - runs a command in the "test" container and prints the output
  • test.sh - runs a nginx container that bind port 8080 in the "test" container and prints the output

Contributing

Contributions to Ubuntudind are welcome!
Interested users can refer to the guidelines provided in the CONTRIBUTING.md file to contribute to the project and help improve its functionality and features.

License

Ubuntudind is licensed under the MIT license, providing users with flexibility and freedom to use and modify the software according to their needs.

Disclaimer

Ubuntudind is provided without warranties.
Users are advised to review the accompanying license for more information on the terms of use and limitations of liability.

About

Ubuntu Docker in Docker - a ubuntu 24.04 docker in docker image

License:MIT License


Languages

Language:Shell 55.2%Language:Dockerfile 44.8%