Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up a custom Ubuntu Docker image


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

Fetch/Update the official Ubuntu docker image,

docker pull ubuntu

Prepare your Dockerfile and install scripts,

mkdir -p ~/images/ubuntu/upload/
cd ~/images/ubuntu/
cd upload/
chmod +x *

Build the custom image,

cd ~/images/ubuntu/
docker build -t custom/ubuntu .

note. -t to tag/name the docker image

Launch the custom Ubuntu container

Make sure /data/$app doesn’t exist yet and proceed,

app=<app name>
docker ps -a | grep $app
docker run -d --name $app -h $app \
    -p 8080:80 -p 8443:443 \
    -v /data/$app:/$app \
docker ps -a | grep $app
docker logs $app
docker exec -ti $app bash


References about volumes

Home | GitHub | Donate | Contact