docker run ubuntu sleeper 1 2 3 4 5 sleep missing operand Try sleep help for

Docker run ubuntu sleeper 1 2 3 4 5 sleep missing

This preview shows page 66 - 82 out of 138 pages.

docker run ubuntu-sleeper 1 2 3 4 5
Image of page 66
sleep: missing operand Try 'sleep --help' for more information. FROM Ubuntu CMD sleep 5 docker run ubuntu-sleeper sleep 10 docker run ubuntu-sleeper 10 FROM Ubuntu ENTRYPOINT [“sleep”] Command at Startup: sleep 10 Command at Startup: sleep 10 docker run ubuntu-sleeper Command at Startup:
Image of page 67
Command at Startup: sleep: missing operand Try 'sleep --help' for more information. docker run ubuntu-sleeper Command at Startup: FROM Ubuntu ENTRYPOINT [“sleep”] CMD [“ 5 ”] sleep 5 docker run ubuntu-sleeper 10 10 sleep docker run --entrypoint sleep2.0 ubuntu-sleeper 10 Command at Startup: sleep2.0 10
Image of page 68
Image of page 69
networking d o c k e r
Image of page 70
Default networks Bridge none host docker run ubuntu docker run Ubuntu -network=none docker run Ubuntu --network=host Docker Host Web Container Web Container Web Container Web Container docker0 172.17.0.1 172.17.0.2 172.17.0.3 172.17.0.4 172.17.0.5 Docker Host Web Container 5000 Web Container 5000 Docker Host Web Container
Image of page 71
User-defined networks Docker Host Web Container Web Container Web Container Web Container docker0 172.17.0.1 172.17.0.2 172.17.0.3 172.17.0.4 172.17.0.5 docker0 182.18.0.1 182.18.0.3 182.18.0.2 docker network create \ -driver bridge \ - subnet 182.18.0.0/16 custom-isolated-network docker network ls
Image of page 72
Inspect Network docker inspect blissful_hopper [ { "Id": "35505f7810d17291261a43391d4b6c0846594d415ce4f4d0a6ffbf9cc5109048", "Name": "/blissful_hopper", "NetworkSettings": { "Bridge": "", "Gateway": "172.17.0.1", "IPAddress": "172.17.0.6", "MacAddress": "02:42:ac:11:00:06", "Networks": { "bridge": { "Gateway": "172.17.0.1", } } } ]
Image of page 73
Embedded DNS Docker Host web Container mysql Container docker0 172.17.0.2 172.17.0.3 mysql.connect( ) mysql Host IP web 172.17.0.2 mysql 172.17.0.3 DNS Server 127.0.0.11
Image of page 74
Image of page 75
storage d o c k e r
Image of page 76
File system /var/lib/docker aufs containers image volumes
Image of page 77
Layered architecture Dockerfile FROM Ubuntu RUN apt-get update && apt-get y install python RUN pip install flask flask-mysql COPY . /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app.py flask run docker build Dockerfile t mmumshad/my-custom-app Layer 1. Base Ubuntu Layer Layer 2. Changes in apt packages Layer 3. Changes in pip packages Layer 4. Source code Layer 5. Update Entrypoint 120 MB 306 MB 6.3 MB 229 B 0 B Dockerfile2 FROM Ubuntu RUN apt-get update && apt-get y install python RUN pip install flask flask-mysql COPY app2.py /opt/source-code ENTRYPOINT FLASK_APP=/opt/source-code/app2.py flask run docker build Dockerfile2 t mmumshad/my-custom-app-2 Layer 1. Base Ubuntu Layer Layer 2. Changes in apt packages Layer 3. Changes in pip packages Layer 4. Source code Layer 5. Update Entrypoint 0 MB 0 MB 0 MB 229 B 0 B
Image of page 78
Layered architecture Layer 1. Base Ubuntu Layer Layer 2. Changes in apt packages Layer 3. Changes in pip packages Layer 4. Source code Layer 5. Update Entrypoint with “flask” command Image Layers docker build Dockerfile t mmumshad/my-custom-app docker run mmumshad/my-custom-app Read Only Layer 6. Container Layer Read Write Container Layer
Image of page 79
COPY-ON-WRITE Image Layers Read Only Read Write Container Layer app.py temp.txt
Image of page 80
/var/lib/docker/volumes volumes mysql image layer Read Only mysql-container layer Read Write /var/lib/docker volumes docker volume create data_volume data_volume Docker Host data_volum e docker run v data_volume:/var/lib/mysql mysql /var/lib/mysql docker run
Image of page 81
Image of page 82

You've reached the end of your free preview.

Want to read all 138 pages?

  • Spring '14

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture