Ronen Shachar
Docker is an open platform for developing, shipping, and running applications. Docker is designed to deliver your applications faster. With Docker you can separate your applications from your infrastructure AND treat your infrastructure like a managed application. Docker helps you ship code faster, test faster, deploy faster, and shorten the cycle between writing code and running code.
Docker images are then built from these base images using a simple, descriptive set of steps we call instructions.
Each instruction creates a new layer in our image.
ubuntu@ip-172-31-1-114:~/docker$ docker run -d -P training/webapp python app.py
Unable to find image 'training/webapp:latest' locally
latest: Pulling from training/webapp
23f0158a1fbe: Pull complete
0a4852b23749: Downloading [==========================================> ] 17.51 MB/20.71 MB
7d0ff9745632: Downloading [=============> ] 13.77 MB/50.25 MB
99b0d955e85d: Download complete
33e109f2ff13: Download complete
cc06fd877d54: Download complete
b1ae241d644a: Download complete
b37deb56df95: Download complete
02a8815912ca: Download complete
e9e06b06e14c: Already exists
a82efea989f9: Already exists
37bea4ee0c81: Already exists
07f8e8c5e660: Already exists
ubuntu@ip-172-31-1-114:~/docker$ docker run -d -P training/webapp python app.py
Unable to find image 'training/webapp:latest' locally
latest: Pulling from training/webapp
23f0158a1fbe: Pull complete
0a4852b23749: Pull complete
7d0ff9745632: Downloading [=======================> ] 23.43 MB/50.25 MB
7d0ff9745632: Pull complete
99b0d955e85d: Pull complete
33e109f2ff13: Pull complete
cc06fd877d54: Pull complete
b1ae241d644a: Pull complete
b37deb56df95: Pull complete
02a8815912ca: Already exists
a82efea989f9: Already exists
37bea4ee0c81: Already exists
07f8e8c5e660: Already exists
Digest: sha256:06e9c1983bd6d5db5fba376ccd63bfa529e8d02f23d5079b8f74a616308fb11d
Status: Downloaded newer image for training/webapp:latest
0be5d724dbd54a24b558a4ba3bcf312e885b41fe38057042c1e5f0132f5ee860
$ docker run ubuntu:14.04 /bin/echo 'Hello world'/bin/echo 'Hello world'Hello world$ docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"/bin/sh -c "while true; do echo hello world; sleep 1; done"1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1e5535038e28 ubuntu:14.04 /bin/sh -c 'while tr 2 minutes ago Up 1 minute insane_babbage$ docker logs insane_babbagehello world
hello world
hello world
. . .List containers
Look inside the container
$ docker stop insane_babbageinsane_babbageStop container
$ swarm create$ swarm join --add=<node_ip> token://<token>$ swarm manage --addr=<swarm_ip> token://<token>Sample code
git clone https://github.com/ronen-shachar/docker-samples.git
Ronen Shachar @ronen_shachar