Created
September 19, 2017 14:57
-
-
Save xbalaji/f5e63540f759ea6c56d9a0b3ce635ae3 to your computer and use it in GitHub Desktop.
ansible training docker setup
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
# start the containers | |
docker run --name web1 -d -t ubuntu | |
docker run --name web2 -d -t ubuntu | |
docker run --name db1 -d -t ubuntu | |
# print the ip addresses of the containers | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' we b1 | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' we b2 | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' db 1 | |
docker exec -i -t web1 /bin/bash | |
docker exec -i -t web2 /bin/bash | |
docker exec -i -t db1 /bin/bash | |
In each container run the following | |
apt -y update | |
apt -y upgrade | |
apt-get install -y python-minimal --no-install-recommends | |
python --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment