├── .dockerignore ├── .github └── workflows │ └── image.yml ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── deamon.json └── scripts ├── attach.sh ├── build.sh ├── checkbin.sh ├── close.sh ├── enter.sh ├── exec.sh ├── start.sh └── test.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !deamon.json -------------------------------------------------------------------------------- /.github/workflows/image.yml: -------------------------------------------------------------------------------- 1 | name: Image 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | schedule: 8 | - cron: 10 13 * * 6 9 | 10 | jobs: 11 | test: 12 | name: Test docker image 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | - name: Build docker image 18 | run: ./scripts/build.sh 19 | - name: Run built image 20 | run: ./scripts/start.sh 21 | - name: Check (max 5 times) if docker image is running 22 | run: for i in {1..5}; do docker exec --tty ${{ github.event.repository.name }} env TERM=xterm docker info && break || sleep 10; done 23 | - name: Clean up 24 | run: ./scripts/close.sh 25 | 26 | release: 27 | name: Release ubuntu(latest) dind 28 | runs-on: ubuntu-latest 29 | needs: test 30 | env: 31 | imagename: noblemajo/ubuntudind 32 | steps: 33 | - name: Set up QEMU 34 | uses: docker/setup-qemu-action@v3 35 | - name: Set up Docker Buildx 36 | uses: docker/setup-buildx-action@v3 37 | - name: Login to docker hub 38 | uses: docker/login-action@v3 39 | with: 40 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 41 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 42 | - name: Build and push 43 | uses: docker/build-push-action@v6 44 | with: 45 | platforms: linux/amd64 #,linux/arm64 46 | push: true 47 | tags: | 48 | ${{ env.imagename }}:latest 49 | ${{ env.imagename }}:${{ github.sha }} 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .store 3 | 4 | !.keep 5 | !.gitkeep -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We welcome contributions from the community to help improve this project. 4 | Your input is valuable to us. 5 | 6 | You can contribute to the project in the following ways: 7 | 8 | ### **Create Issues** 9 | Feel free to create issues for: 10 | - feature requests, 11 | - bug fixes, 12 | - documentation improvements, 13 | - test cases, 14 | - general questions, 15 | - or any recommendations you may have. 16 | ### **Merge Requests** 17 | Please avoid multiple different changes in one merge request. 18 | 1. **Fork** the repository, 19 | 2. **commit and push** your changes, 20 | 3. and submit your **merge request**: 21 | - with a clear explanation of the changes you've made, 22 | - and a note with your thoughts about your tests. 23 | 24 | There are many reasons for submitting a merge request: 25 | - Fixing bugs, 26 | - implement new features, 27 | - improve documentation, 28 | - and adding tests. 29 | 30 | ## Rules for Contributions 31 | 32 | To ensure a smooth contribution process, please follow the rules below: 33 | 34 | - **License Awareness**: Be aware of and check the LICENSE file before contributing to understand the project's licence terms. 35 | - **Respect the Licence Terms**: Ensure that your contributions comply with the project's license terms. 36 | - **Avoid Plagiarism**: Do not plagiarise code or content from other sources. All contributions should be original work or properly attributed. 37 | - **Platform Rules** Also be sure to follow the rules of the provider and the platform. 38 | 39 | ## Thank you 40 | A big thank you, for considering a contribution. 41 | If anything is unclear, please contact us via a issue with your question. 42 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker:dind-rootless as dind-source 2 | 3 | FROM ubuntu:latest 4 | 5 | LABEL version="1.3" maintainer="NobleMajo (Majo Richter) " 6 | 7 | ENV DEBIAN_FRONTEND=noninteractive 8 | 9 | RUN apt-get update && \ 10 | apt-get install -y --no-install-recommends \ 11 | ca-certificates iptables && \ 12 | apt-get autoremove -y && \ 13 | apt-get clean && \ 14 | apt-get autoclean && \ 15 | rm -rf /var/lib/apt/lists/* && \ 16 | rm -rf /var/cache/apk/* && \ 17 | rm -rf /tmp/* 18 | 19 | COPY --from=dind-source /usr/local/bin/ /usr/local/bin/ 20 | COPY ./deamon.json /etc/docker/daemon.json 21 | 22 | VOLUME /var/lib/docker 23 | USER root 24 | 25 | CMD ["dockerd"] 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Majo Richter (NobleMajo) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ubuntudind 2 | ![Docker](https://img.shields.io/docker/image-size/noblemajo/ubuntudind) 3 | ![CI/CD](https://github.com/noblemajo/ubuntudind/workflows/Image/badge.svg) 4 | ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) 5 | 6 | ![](https://img.shields.io/badge/dynamic/json?color=green&label=watchers&query=watchers&suffix=x&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fubuntudind) 7 | ![](https://img.shields.io/badge/dynamic/json?color=yellow&label=stars&query=stargazers_count&suffix=x&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fubuntudind) 8 | ![](https://img.shields.io/badge/dynamic/json?color=orange&label=subscribers&query=subscribers_count&suffix=x&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fubuntudind) 9 | ![](https://img.shields.io/badge/dynamic/json?color=navy&label=forks&query=forks&suffix=x&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fubuntudind) 10 | ![](https://img.shields.io/badge/dynamic/json?color=darkred&label=open%20issues&query=open_issues&suffix=x&url=https%3A%2F%2Fapi.github.com%2Frepos%2Fnoblemajo%2Fubuntudind) 11 | 12 | # table of contents 13 | - [ubuntudind](#ubuntudind) 14 | - [table of contents](#table-of-contents) 15 | - [about](#about) 16 | - [example commands](#example-commands) 17 | - [pull image](#pull-image) 18 | - [Own docker sock](#own-docker-sock) 19 | - [Host sock](#host-sock) 20 | - [Exec commands](#exec-commands) 21 | - [Nginx example](#nginx-example) 22 | - [Persistent data](#persistent-data) 23 | - [Control Scripts](#control-scripts) 24 | - [Contributing](#contributing) 25 | - [License](#license) 26 | - [Disclaimer](#disclaimer) 27 | 28 | # about 29 | The main focus of this project is to provide a ubuntu image with functional docker deamon. 30 | You can use this image to run docker containers in a ubuntu container. 31 | 32 | ## docker hub 33 | This repo is also on [Docker Hub](https://hub.docker.com/r/noblemajo/ubuntudind). 34 | 35 | ## automated updates 36 | The build image is automatically updated without worrying about a dead repo or less maintenance. 37 | 38 | # requirements 39 | This container needs the '--privileged' flag to run! 40 | This gives extended privileges to this container. 41 | 42 | # example commands 43 | ## pull image 44 | ```sh 45 | docker push noblemajo/ubuntudind 46 | ``` 47 | ## own docker sock 48 | Start the container as self hosting docker instance: 49 | ```sh 50 | docker run -d --privileged \ 51 | --restart unless-stopped \ 52 | --name ubuntudind \ 53 | --network host \ 54 | noblemajo/ubuntudind 55 | ``` 56 | ## host sock 57 | You can also mount the host docker socket into the container: 58 | ```sh 59 | docker run -it --rm \ 60 | -v /var/run/docker.sock:/var/run/docker.sock \ 61 | noblemajo/ubuntudind \ 62 | docker ps 63 | ``` 64 | ## exec commands 65 | ```sh 66 | docker exec -it ubuntudind \ 67 | docker ps 68 | ``` 69 | ## nginx example 70 | ```sh 71 | docker exec -it ubuntudind \ 72 | docker run -it --rm \ 73 | --name test-nginx \ 74 | -p 8080:80 \ 75 | nginx 76 | ``` 77 | Don't forget to remove it: 78 | ```sh 79 | docker rm -f ubuntudind 80 | ``` 81 | ## persistent data 82 | The container data need to be mounted for persistency: 83 | ```sh 84 | docker run -d --privileged \ 85 | --restart unless-stopped \ 86 | --name ubuntudind \ 87 | --network host \ 88 | -v $(pwd)/.store:/var/lib/docker \ 89 | noblemajo/ubuntudind 90 | ``` 91 | 92 | # control Scripts 93 | This control scripts should help you to understand how to use the image and container. 94 | - build.sh - build docker image 95 | - enter.sh - run a container with bash as entrypoint for image testing and debugging purposes 96 | - start.sh - run docker "test" container with network, volume and backup/cache mount to "./.store" 97 | - remove.sh - remove docker "test" container 98 | - exec.sh - runs a command in the "test" container and prints the output 99 | - test.sh - runs a nginx container that bind port 8080 in the "test" container and prints the output 100 | 101 | # Contributing 102 | Contributions to Ubuntudind are welcome! 103 | Interested users can refer to the guidelines provided in the [CONTRIBUTING.md](CONTRIBUTING.md) file to contribute to the project and help improve its functionality and features. 104 | 105 | # License 106 | Ubuntudind is licensed under the [MIT license](LICENSE), providing users with flexibility and freedom to use and modify the software according to their needs. 107 | 108 | # Disclaimer 109 | Ubuntudind is provided without warranties. 110 | Users are advised to review the accompanying license for more information on the terms of use and limitations of liability. 111 | -------------------------------------------------------------------------------- /deamon.json: -------------------------------------------------------------------------------- 1 | { 2 | "storage-driver": "vfs" 3 | } -------------------------------------------------------------------------------- /scripts/attach.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker logs ubuntudind 4 | docker attach ubuntudind -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build -t ubuntudind . -------------------------------------------------------------------------------- /scripts/checkbin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Source:" 4 | docker run -it --rm \ 5 | docker:latest \ 6 | ls -al /usr/local/bin/ 7 | 8 | echo "Build:" 9 | docker run -it --rm \ 10 | ubuntudind \ 11 | ls -al /usr/local/bin/ 12 | -------------------------------------------------------------------------------- /scripts/close.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker rm -f ubuntudind 4 | -------------------------------------------------------------------------------- /scripts/enter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker run -it --privileged --rm \ 4 | --name ubuntudind-test \ 5 | --network host \ 6 | ubuntudind \ 7 | bash -------------------------------------------------------------------------------- /scripts/exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker exec -it ubuntudind $@ 4 | -------------------------------------------------------------------------------- /scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./close.sh 4 | 5 | docker run -d --privileged \ 6 | --restart unless-stopped \ 7 | --name ubuntudind \ 8 | --network host \ 9 | -v $(pwd)/.store:/var/lib/docker \ 10 | ubuntudind 11 | -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./exec.sh \ 4 | docker run -it --rm \ 5 | --name test-nginx \ 6 | -p 8080:80 \ 7 | nginx --------------------------------------------------------------------------------