demoBox is a tool that allows you to quickly and easily provision multiple Docker containers for SSH login. It's useful for:
- CTFs
- Practically teaching about GNU/Linux
- Testing in multiple environments
Follow the steps and run the commands
git clone https://github.com/StuckInVim-dev/demoBox
cd demoBox
- Place directories with the dockerfiles into the
children
directory (There is already one inchildren/demo
) - (Optional) If you want to customize the command that starts the container when logging in, make a directory in
custom_children
and add an extra file to it with the namedosh
. This file will be used as the user's shell. - Deploy the container by running
docker compose up --force-recreate --build
You just need to have docker installed and have your user be in the docker
group
If You want to run Docker in Docker (DIND) You will need to have the sysbox runtime installed on your host machine
The setup of all the containers is done by the setup
script, it does the following steps every time when ran:
- When the master container is ran, it builds all the container from the passed in
children
directory (Containers that have already been build will be loaded from cache, because the cache is stored on the host) - Creates a user for each child container (for SSH)
- Starts the SSH service.
When anyone tries to connect to the master container with SSH as a user that was created for the child containers, they interactively start the container with the same name as the user they logged in as.