Docker In Docker (DIND) provides an interface for sending Docker commands between Docker containers. The initial use case for this package was to restart 'webserver' containers after updated SSL certificates had been retrieved by a 'certbot' container
Docker images can be pulled using the Docker CLI.
docker pull stephenneal/dind:alpine-3.12-v1
Add a 'docker' container with the container's Docker socket mapped to Docker socket of the host machine in order to execute Docker commands.
docker:
image: stephenneal/dind:alpine-3.12-v1
container_name: docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- container_name=webserver proxy
- container_cmd=/scripts/reload.sh
- wait_for_container=certbot
depends_on:
- certbot
In this example the 'docker' container will execute the 'reload.sh' script in the 'webserver' & 'proxy' container's once the 'certbot' container has stopped running. 'dind' will check every 5 seconds to determine if the 'certbot' container has stopped. Once it has stopped, 'dind' executes the command specified by the container_cmd
environement variable. After all commands have been executed, 'dind' stops running as well.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email stephen.neal14@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.