Docker is an open platform for developers and sysadmins to build,ship and run distributed applications
Docker’s philosophy is “build->ship->run”.
In contemporary IT industry, there are two major usage of
- Focus on Build & Ship, to leverage Docker to setup a platform of “CI/CD”, for develop, test enviornment.
- Make use of Docker as light weight VM (virtual machine), focus on
Run, apply it in large scale production environment.
the access control in docker is rely on iptables, the firewall software shipped in almost all Linux release.
List all images
sudo docker version
docker rm $(docker ps -a -f status=exited -q)
docker run IMAGE_NAME [COMMAND] # run a command in new container
docker inspect containerid
docker -t -i imageFile /bin/bash
docker -P xxx
It means host port 32768 map to port 5000 in contains
docker ps -a # show all containers instead of only running as default
docker run --rm -name myApp1 -link db:db training/webapp env
Be advised there is no built-in ping for containers, therefore it’s requried manually install one. As following sample:
apt-get install -yqq inetutils-ping