Building a dumb-init Ubuntu Docker image

Introduction

I am using a fake init for debuging and to make sure the container will always be able to start without issue. You can change the CMD statement once you are done with debugging.

Preparing the custom image

as user – member of the docker group

Fetch/Update the official Ubuntu docker image

docker pull ubuntu

Prepare your Dockerfile and install scripts

mkdir -p ~/images/ubuntu/

cd ~/images/ubuntu/
wget https://pub.nethence.com/bin/docker/ubuntu/Dockerfile.txt
wget https://pub.nethence.com/bin/docker/ubuntu/install.bash.txt
for f in *.txt; do mv $f ${f%\.txt}; done; unset f
chmod +x install.bash

Generate the custom image

time nice docker build -t pbraun9/ubuntu ./
# 5m50.510s on xc
# 5m32.232s on xc
# 5m36.119s on xc
# 2m49,731s on bravo

Acceptance

    docker run -d --name ubuntu --hostname ubuntu --workdir /root pbraun9/ubuntu
    docker logs ubuntu
docker exec -ti ubuntu /bin/bash

echo $container
    ps auxfw
dpkg -l | grep postfix # nope
tail -30 /etc/bash.bashrc
echo $MAKEFLAGS
    service uuidd status
    ^D

    docker rm ubuntu --force

see operations

Result on Docker Hub

    docker login -u pbraun9
    docker push pbraun9/ubuntu

Ubuntu bare-system image with dumb-init https://hub.docker.com/r/pbraun9/ubuntu

Resources

docker build https://docs.docker.com/engine/reference/commandline/build/

Get Started, Part 1: Orientation and Setup https://docs.docker.com/get-started/

Dockerfile https://hub.docker.com/r/wemakecustom/ubuntu-dev/~/dockerfile/

Installing MariaDB/MySQL with Docker http://amattn.com/p/installing_maria_db_mysql_with_docker.html

volumes

Understanding Volumes in Docker http://container-solutions.com/understanding-volumes-docker/

How To Share Data between the Docker Container and the Host https://www.digitalocean.com/community/tutorials/how-to-share-data-between-the-docker-container-and-the-host

How To Share Data between Docker Containers https://www.digitalocean.com/community/tutorials/how-to-share-data-between-docker-containers

moar

How to source a script with environment variables in a docker build process? https://stackoverflow.com/questions/55921914/how-to-source-a-script-with-environment-variables-in-a-docker-build-process

Docker expose all ports or range of ports from 7000 to 8000 https://stackoverflow.com/questions/28717464/docker-expose-all-ports-or-range-of-ports-from-7000-to-8000


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun