My name is Vasyl Khrystiuk‎ > ‎process‎ > ‎main‎ > ‎


docker run ubuntu /bin/echo 'Hello world'
docker run -t -i ubuntu /bin/bash
-i -- interactive
-t -- assigt tty to terminal
$ docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done"
-d -- deamon

$ docker ps
CONTAINER ID        IMAGE               COMMAND                    CREATED                 STATUS              PORTS           NAMES
0890757debe9        ubuntu              "/bin/sh -c 'while tr"   24 seconds ago     Up 24 seconds                           sick_jang

$ docker logs 0890757debe9

$ docker stop 0890757debe9

$ docker version
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 21:49:11 2016
 OS/Arch:      windows/amd64

 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 21:49:11 2016
 OS/Arch:      linux/amd64

$ docker run -d -P training/webapp python
-P -- map ports

$ docker ps 
CONTAINER ID  IMAGE                   COMMAND          CREATED            STATUS            PORTS                        
23fdd9b7f5e5   training/webapp  "python"  35 seconds ago  Up 35 seconds>5000/tcp 


$ docker-machine ip

$ docker logs 23fdd9b7f5e5
 * Running on (Press CTRL+C to quit) - - [18/Apr/2016 17:30:24] "GET / HTTP/1.1" 200 - - - [18/Apr/2016 17:30:25] "GET /favicon.ico HTTP/1.1" 404 -

$ docker top nostalgic_blackwell
PID                 USER                COMMAND
3642                root                python

$ docker inspect nostalgic_blackwell

$ docker ps -l
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
23fdd9b7f5e5        training/webapp     "python"     11 minutes ago      Exited (137) 3 seconds ago                       nostalgic_blackwell

$ docker search jetty
NAME                                   DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
jetty                                  Jetty provides a Web server and javax.serv...   99        [OK]
consol/jetty-9                         Jetty 9.2.6, 8080                               3                    [OK]

$ docker run -d -p 8080:8080 jetty

$ pwd

$ mkdir sinatra
$ cd sinatra
$ touch Dockerfile

# This is a comment
FROM ubuntu:15.10
MAINTAINER Kate Smith <>
RUN apt-get update && apt-get install -y ruby ruby-dev
RUN gem install sinatra

$ cd ..
$ pwd

$ docker build sinatra
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM ubuntu:15.10
15.10: Pulling from library/ubuntu
Digest: sha256:17f945471be169657c2e95e368e585bcdf70b8732764b1bb24216f128b433078
Status: Downloaded newer image for ubuntu:15.10
 ---> 4e3b13c8a266
Step 2 : MAINTAINER Kate Smith <>
 ---> Running in f866e4abd583
 ---> 49b324f63aa2
Removing intermediate container f866e4abd583
Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev
 ---> Running in 7a340950599b
Hit wily InRelease
Fetched 21.9 MB in 45s (485 kB/s)
Running hooks in /etc/ca-certificates/update.d...
 ---> 11a4817968b3
Removing intermediate container 7a340950599b
Step 4 : RUN gem install sinatra
 ---> Running in 360ce9fc75dd
Done installing documentation for rack, rack-protection, sinatra, tilt after 100 seconds
4 gems installed
 ---> 25d64864f21e
Removing intermediate container 360ce9fc75dd
Successfully built 25d64864f21e

$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              25d64864f21e        6 minutes ago       192.9 MB
ubuntu              latest              b72889fa879c        4 days ago          188 MB
jetty               latest              9f39c8e306cd        13 days ago         320.2 MB
ubuntu              15.10               4e3b13c8a266        13 days ago         136.3 MB
training/webapp     latest              6fae60ef3446        11 months ago       348.8 MB

$ docker tag 25d64864f21e ouruser/sinatra:devel
$ docker run -t -i ouruser/sinatra:devel
root@ccaec179e005:/# ls


To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: 
>docker-machine env msangel-host

C:\Users\Vasya>docker-machine env msangel-host
SET DOCKER_CERT_PATH=C:\Users\Vasya\.docker\machine\machines\msangel-host
REM Run this command to configure your shell:
REM     FOR /f "tokens=*" %i IN ('docker-machine env msangel-host') DO %i

C:\Users\Vasya>docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS
8dc2b12ea5ee        training/webapp     "python"     5 minutes ago       Up 5 minutes>5000/
tcp   nostalgic_bardeen

C:\Users\Vasya>docker-machine ls
NAME           ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default        -        virtualbox   Running   tcp://           v1.10.3
msangel-host   *        vscale       Running   tcp://           v1.11.0