docker 入門 introduction to docker

27
Agenda 1. What is Docker 2. Image & Container 3. Dockerfile 4. Dockerhub & Docker Registry 6. Main process in container 7. Volume 8. Networking

Upload: genchi-lu

Post on 05-Apr-2017

139 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Docker 入門  Introduction to Docker

Agenda

1. What is Docker 2. Image & Container 3. Dockerfile 4. Dockerhub & Docker Registry 6. Main process in container 7. Volume 8. Networking

Page 2: Docker 入門  Introduction to Docker

What is Docker “I’ have a linux, I have a docker.

umm..! Container !”

Page 3: Docker 入門  Introduction to Docker

What is Docker

• (X)

• Container (O)

Page 4: Docker 入門  Introduction to Docker

What is Docker

Page 5: Docker 入門  Introduction to Docker

What is Docker

Page 6: Docker 入門  Introduction to Docker

What is Docker• running centos6 on vm:

• linux kernel is 2.6.x

• running centos6 in docker on centos7:

• linux kernel is 3.10.x

• running centos6 in docker on ubuntu16:

• linux kernel is 4.4.x

Page 7: Docker 入門  Introduction to Docker

Image and Container “ ”

Page 8: Docker 入門  Introduction to Docker

Image and Container

Page 9: Docker 入門  Introduction to Docker

Image and Container

Page 10: Docker 入門  Introduction to Docker

Dockerfile “ ”

Page 11: Docker 入門  Introduction to Docker

Dockerfile

vim Dockerfile

Page 12: Docker 入門  Introduction to Docker

Docker file

Page 13: Docker 入門  Introduction to Docker

Dockerhub & Private registry

“ image push pull ”

Page 14: Docker 入門  Introduction to Docker

Dockerhub & Private registry

• Docker image location/name:tag

• location image ( docker.io)

• name image

• tag ( latest)

Page 15: Docker 入門  Introduction to Docker

Dockerhub & Private registry • docker push image image push

pull

• Example

• docker push genchi/myimage

• push image docker hub genchilu user

• docker push docker-registry:5000/myimage

• push docker-registry:5000 server

Page 16: Docker 入門  Introduction to Docker

Main process in container

“ ”

Page 17: Docker 入門  Introduction to Docker

Main process in container

• image container main process ( process container pid 1)

• main process container close

• container ( deamon container close)

Page 18: Docker 入門  Introduction to Docker

Main process in container

Page 19: Docker 入門  Introduction to Docker

Volume “volume data ”

Page 20: Docker 入門  Introduction to Docker

Volume

Page 21: Docker 入門  Introduction to Docker

Volume

• docker run -v host-dir:container-dir image

Page 22: Docker 入門  Introduction to Docker

Networking “ ”

Page 23: Docker 入門  Introduction to Docker

Networking

Page 24: Docker 入門  Introduction to Docker

Networking

• docker network

Page 25: Docker 入門  Introduction to Docker

Networking

• net

Page 26: Docker 入門  Introduction to Docker

Networking

• port

Page 27: Docker 入門  Introduction to Docker

Networking• host container

port docker-proxy