Created
April 4, 2018 18:29
-
-
Save udkyo/67bb60565227ef5cda1b10162401a96d to your computer and use it in GitHub Desktop.
docker-compose network thing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
spawner: | |
image: docker | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
entrypoint: | | |
sh -c "docker run --rm --name childcontainer --network ${stack}_default -d alpine sleep 10 && ping childcontainer" | |
# dump it in a folder and run it with: | |
# stack=$(basename $PWD) docker-compose up | |
# | |
# spawner will come up, create a child container on the compose file's default network and ping it until stopped | |
# childcontainer evaporates after 10 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment