Here's the set of command which I will execute while presenting "Docker - A Gentle Introduction".
docker pull alpine
docker image ls
cd /vagrant/docker/prs-tomcat
vim Dockerfile
docker build . -t my-tomcat
docker build . -t my-tomcat --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy
docker history my-tomcat
Modify the Dockerfile to also install procps
echo "RUN apt-get install -y procps" >> Dockerfile
docker container run --name my-tomcat-container my-tomcat
ps -ef | grep tomcat
docker ps
docker exec -it my-tomcat-container /bin/bash
docker network ls
docker network create --driver bridge my-bridge
docker container run -itd --name busy1 busybox
docker container run -itd --name busy2 busybox
docker network connect my-bridge busy1
docker network connect my-bridge busy2
docker network inspect my-bridge
docker attach busy1
ping busy2
docker container run --rm -itd --name busy busybox
docker attach busy
# Inside the container
touch persist.txt; \
echo hello >> persist.txt ;\
cat persist.txt ;
exit
docker container ls --all
docker container run --rm -itd --name busy busybox
docker attach busy
# Inside the container
cat persist.txt
exit
docker container run --rm -itd --name busy -v vol:/volume busybox
docker attach busy
touch /volume/persist.txt
echo hello >> /volume/persist.txt
cat /volume/persist.txt
exit
docker container ls --all
docker container run --rm -v vol:/volume busybox cat /volume/persist.txt
docker volume ls
docker container run --rm -it --name busy -v $(pwd):/volume1 busybox
cd ../iip-jenkins
vim docker-compose.yml
docker-compose build
docker-compose up
docker swarm init --advertise-addr <ip-address of the instance>
docker service create alpine ping 8.8.8.8
docker service update --replicas 3 <serivce-id>
docker container rm -f <container-id>
watch "docker service ls"
docker node ls
docker service create --replicas 4 --name four-alpines alpine ping 8.8.8.8
docker node update --availability drain manager2