- If You Do Not Have Docker, please first install Docker * Docker Installation Instructions: Ubuntu | Windows | MacOSX
The easiest way to launch your containers is using the automated launcher
One of the core fundamentals of the Docker In Docker project is standardized structure. If you just want to launch one of the pre-made containers, or load a dataset given to you, just follow the instructions below.
However, If you want to customize or incorporate your own setup for Docker In Docker, or contribute to this project you will need to learn a few of the key structural aspects of the D-in-D system.
- The structure is typically like this: 1 Outer Container with 3 Inner Containers running.
===============OUTER CONTAINER==================
/ ___________________________________________ /
/ | (inner 1) | (inner 2) | (inner 3) | /
/ | | | Volumerize | /
/ | Software | Database | (backups & | /
/ | (ex: Piwik) | (ex: MariaDB)| restore) | /
/ ___________________________________________ /
/ /
================================================
- When the outer container is first launched, the inner containers are not active yet. The second command in each example below is the command to launch the inner containers.
- All the scripts related to container interaction is in the outer container's path:
/TensorCloud/DockerInDocker/ - The Software and Database containers have a volume mapped to 2 '_data'folders in:
/TensorCloud/DockerInDocker/of the outer container, ex:piwik_dataandmariadb_data. The volumes store all of the user and database data, including user file uploads, etc. These folders are then used by Volumerize whenever creating backups. As Volumerize saves the backups into the Outer Container, it is important to add a volume from the container to the root server. - All the dind container images are available on Docker Hub. The specific containers mentioned in this documentation are: Wordpress, Mediawiki, Piwik
First, get the empty dind-container image setup from Dockerhub.
docker pull tuitu/dind-wordpress:latest
Second, use this command to launch the container. NOTE: should change the following in line 2:
- Change
your_wordpress_container_nameto any name you want to give the container. - Change the first port number in
-p 4445:4445to whichever port you want to use. (ex: 80:4445, 888:4445, etc.)
docker run \
--name your_wordpress_container_name -p 4445:4445 \
-e DOCKER_DAEMON_ARGS="-D" -e PORT=4445 -e APP_NAME="wordpress" \
--privileged -d tuitu/dind-wordpress:latest
Next, use the following command to activate the inner containers. (Remember to change your_wordpress_container_name) to the same container name from step 1.2
docker exec -it your_wordpress_container_name \
bash /TensorCloud/DockerInDocker/mariadb_wordpress_4445.sh
First, get the empty dind-container image setup from Dockerhub.
docker pull tuitu/dind-mediawiki:latest
Second, use this command to launch the container. NOTE: should change the following in line 2:
- Change
your_mediawiki_container_nameto any name you want to give the container. - Change the first port number in
-p 4444:4444to whichever port you want to use. (ex: 80:4444, 888:4444, etc.)
docker run \
--name your_mediawiki_container_name -p 4444:4444 \
-e DOCKER_DAEMON_ARGS="-D" -e PORT=4444 -e APP_NAME="mediawiki" \
--privileged -d tuitu/dind-mediawiki:latest
Next, use the following command to activate the inner containers. (Remember to change your_mediawiki_container_name) to the same container name from step 1.2
docker exec -it your_mediawiki_container_name \
bash /TensorCloud/DockerInDocker/mariadb_mediawiki_4444.sh
First, get the empty dind-container image setup from Dockerhub.
docker pull tuitu/dind-piwik:latest
Second, use this command to launch the container. NOTE: should change the following in line 2:
- Change
your_piwik_container_nameto any name you want to give the container. - Change the first port number in
-p 4446:4446to whichever port you want to use. (ex: 80:4446, 888:4446, etc.)
docker run \
--name your_piwik_container_name -p 4446:4446 \
-e DOCKER_DAEMON_ARGS="-D" -e PORT=4446 -e APP_NAME="piwik" \
--privileged -d tuitu/dind-piwik:latest
Next, use the following command to activate the inner containers. (Remember to change your_piwik_container_name) to the same container name from step 1.2
docker exec -it your_piwik_container_name \
bash /TensorCloud/DockerInDocker/mariadb_piwik_4446.sh
NOTE: Must change "SOFTWARE" in line 3 to wordpress piwik or mediawiki
docker run -d \
--name volumerize_backup \
-v $PWD/SOFTWARE_data:/source/application_data_SOFTWARE:ro \
-v $PWD/mariadb_data:/source/application_database_data_mariadb:ro \
-v $PWD/backup_volume:/backup \
-v cache_volume:/volumerize-cache \
-e "VOLUMERIZE_SOURCE=/source" \
-e "VOLUMERIZE_TARGET=file:///backup" \
blacklabelops/volumerize
docker exec volumerize_backup backup
zip -r new_backup_file_name.zip backup_volume
Remember to change: your_container_name, new_backup_file_name, and /path/to/save/file
docker cp your_container_name:/TensorCloud/DockerInDocker/new_backup_file_name.zip /path/to/save/file
Copy your backup into the Dind container. Remember to change your_backup & your_container_name
docker cp your_backup.zip your_container_name:/TensorCloud/DockerInDocker/
First enter the DinD Container:
docker exec -it your_container_name bash
cd /TensorCloud/DockerInDocker/
Then unzip the backup:
unzip your_backup.zip
First, stop all the inner-containers.
docker stop $(docker ps -aq)
Then Launch the volumerize_restore docker service,
NOTE: Must change "SOFTWARE" in line 3 to wordpress piwik or mediawiki
docker run -d \
--name volumerize_restore \
-v $PWD/SOFTWARE_data:/source/application_data_SOFTWARE \
-v $PWD/mariadb_data:/source/application_database_data_mariadb \
-v $PWD/backup_volume:/backup:ro \
-v cache_volume:/volumerize-cache \
-e "VOLUMERIZE_SOURCE=/source" \
-e "VOLUMERIZE_TARGET=file:///backup" \
blacklabelops/volumerize
Execute restore task,
docker exec volumerize_restore restore
Finally, verify it.
NOTE: Must change "SOFTWARE" to wordpress piwik or mediawiki
docker-compose -f mariadb_SOFTWARE.yml up -d
Moving Docker Container Images Around
Linux Port Redirects via IP Tables
Adjust Image Size of Docker QCOW2 File
In Ubuntu:
systemctl stop docker
nohup dockerd --storage-opt dm.basesize=150G &