'

Docker: Build, Ship, and Run

Понравилась презентация – покажи это...





Слайд 0

Docker Build, Ship and Run GDG Spaghetti Code Liberec, 6.10.2015 1


Слайд 1

Ladislav Prskavec 4 Twitter: @abtris 4 Blog: http://blog.prskavec.net 4 Site Reliability Engineer (SRE) in Apiary.io GDG Spaghetti Code Liberec, 6.10.2015 2


Слайд 2

GDG Spaghetti Code Liberec, 6.10.2015 3


Слайд 3

What's Docker? GDG Spaghetti Code Liberec, 6.10.2015 4


Слайд 4

Analogy from logistics GDG Spaghetti Code Liberec, 6.10.2015 5


Слайд 5

Goods, wares GDG Spaghetti Code Liberec, 6.10.2015 6


Слайд 6

Containers GDG Spaghetti Code Liberec, 6.10.2015 7


Слайд 7

Why Docker? GDG Spaghetti Code Liberec, 6.10.2015 8


Слайд 8

Fast and scalable GDG Spaghetti Code Liberec, 6.10.2015 9


Слайд 9

Build once, run anywhere GDG Spaghetti Code Liberec, 6.10.2015 10


Слайд 10

Configure once, run anywhere GDG Spaghetti Code Liberec, 6.10.2015 11


Слайд 11

Example of using Docker 4 build documentation in Sphinx with latex support 4 executing code in many different programming languages without requiring a single compiler or script interpreter on your machine - docker exec 4 running gui app in docker at linux GDG Spaghetti Code Liberec, 6.10.2015 12


Слайд 12

Example of using Docker 4 development without install ing many tools at local machine 4 Vagrant, Otto dev 4 continues integration using docker 4 Jenkins, TravisCI, CircleCI 4 DevOps platform for build, deploy and manage apps across any cloud - Tutum GDG Spaghetti Code Liberec, 6.10.2015 13


Слайд 13

Docker Engine GDG Spaghetti Code Liberec, 6.10.2015 14


Слайд 14

Docker Engine GDG Spaghetti Code Liberec, 6.10.2015 15


Слайд 15

VM vs Docker GDG Spaghetti Code Liberec, 6.10.2015 16


Слайд 16

Containers and images docker run hello-world GDG Spaghetti Code Liberec, 6.10.2015 17


Слайд 17

Docker Remote API 4 client & server in Docker 4 docker ps 4 docker build 4 docker push/pull 4 docker run/stop 4 docker inspect GDG Spaghetti Code Liberec, 6.10.2015 18


Слайд 18

Docker lifecycle 4 a build produces an immutable image 4 a container is as instance of the image GDG Spaghetti Code Liberec, 6.10.2015 19


Слайд 19

Docker lifecycle GDG Spaghetti Code Liberec, 6.10.2015 20


Слайд 20

Container lifecycle GDG Spaghetti Code Liberec, 6.10.2015 21


Слайд 21

Dockerfile # Firefox over VNC # # VERSION 0.3 FROM ubuntu # Install vnc, xvfb in order to create a 'fake' display and firefox RUN apt-get update && apt-get install -y x11vnc xvfb firefox RUN mkdir ~/.vnc # Setup a password RUN x11vnc -storepasswd 1234 ~/.vnc/passwd # Autostart firefox (might not be the best way, but it does the trick) RUN bash -c 'echo "firefox" >> /.bashrc' EXPOSE 5900 CMD ["x11vnc", "-forever", "-usepw", "-create"] GDG Spaghetti Code Liberec, 6.10.2015 22


Слайд 22

DockerHub GDG Spaghetti Code Liberec, 6.10.2015 23


Слайд 23

GDG Spaghetti Code Liberec, 6.10.2015 24


Слайд 24

Docker tools GDG Spaghetti Code Liberec, 6.10.2015 25


Слайд 25

Docker compose 4 defining and running multi-container applications with Docker GDG Spaghetti Code Liberec, 6.10.2015 26


Слайд 26

docker-compose.yml web: build: . ports: - "5000:5000" volumes: - .:/code links: - redis redis: image: redis GDG Spaghetti Code Liberec, 6.10.2015 27


Слайд 27

Docker machine 4 Machine lets you create Docker hosts on your computer, on cloud providers, and inside your own data center. 4 part of Docker toolbox 4 replacement for boot2docker GDG Spaghetti Code Liberec, 6.10.2015 28


Слайд 28

Demo GDG Spaghetti Code Liberec, 6.10.2015 29


Слайд 29

Docker swarm 4 Docker Swarm is native clustering for Docker. GDG Spaghetti Code Liberec, 6.10.2015 30


Слайд 30

Kinematic 4 desktop GUI for Docker 4 Mac and Windows only GDG Spaghetti Code Liberec, 6.10.2015 31


Слайд 31

Docker Trusted Registry (DTR) 4 private dedicated image registry GDG Spaghetti Code Liberec, 6.10.2015 32


Слайд 32

Yours private registry 4 storage at S3 docker run \ -d \ -p 5000:5000 \ --restart=always \ --name registry \ registry:2 GDG Spaghetti Code Liberec, 6.10.2015 33


Слайд 33

Open Container 1 ekosystem https://www.mindmeister.com/389671722/open-container-ecosystemformerly-docker-ecosystem 1 GDG Spaghetti Code Liberec, 6.10.2015 34


Слайд 34

GDG Spaghetti Code Liberec, 6.10.2015 35


Слайд 35

Docker at Heroku heroku plugins:install heroku-docker 4 https://gist.github.com/abtris/ 6aca9b2668b8b5af0208 4 app.json must contain: { image: heroku/nodejs } 4 app.json specification GDG Spaghetti Code Liberec, 6.10.2015 36


Слайд 36

Dockerfile - heroku/nodejs # Inherit from Heroku's stack FROM heroku/cedar:14 # Internally, we arbitrarily use port 3000 ENV PORT 3000 # Which version of node? ENV NODE_ENGINE 0.12.2 # Locate our binaries ENV PATH /app/heroku/node/bin/:/app/user/node_modules/.bin:$PATH # Create some needed directories RUN mkdir -p /app/heroku/node /app/.profile.d WORKDIR /app/user # Install node RUN curl -s https://s3pository.heroku.com/node/v$NODE_ENGINE/node-v$NODE_ENGINE-linux-x64.tar.gz | \ tar --strip-components=1 -xz -C /app/heroku/node # Export the node path in .profile.d RUN echo "export PATH=\"/app/heroku/node/bin:/app/user/node_modules/.bin:\$PATH\"" > \ /app/.profile.d/nodejs.sh ONBUILD ADD package.json /app/user/ ONBUILD RUN /app/heroku/node/bin/npm install ONBUILD ADD . /app/user/ GDG Spaghetti Code Liberec, 6.10.2015 37


Слайд 37

Create Dockerfile heroku docker:init $ cat Dockerfile FROM heroku/nodejs GDG Spaghetti Code Liberec, 6.10.2015 38


Слайд 38

Docker compose web: build: . command: 'bash -c ''node index.js''' working_dir: /app/user environment: PORT: 8080 ports: - '8080:8080' shell: build: . command: bash working_dir: /app/user environment: PORT: 8080 ports: - '8080:8080' volumes: - '.:/app/user' GDG Spaghetti Code Liberec, 6.10.2015 39


Слайд 39

Start development environment $ docker-compose up web Building web... ... $ curl "http://$(docker-machine ip dev):8080" GDG Spaghetti Code Liberec, 6.10.2015 40


Слайд 40

Rebuild containers Changes to your app and config. docker-compose build GDG Spaghetti Code Liberec, 6.10.2015 41


Слайд 41

Heroku Release $ heroku create ... $ heroku docker:release ... $ heroku open GDG Spaghetti Code Liberec, 6.10.2015 42


Слайд 42

Demo GDG Spaghetti Code Liberec, 6.10.2015 43


Слайд 43

AWS Release $ docker build -t abtris/docker-liberec-example-app ... $ docker push abtris/docker-liberec-example-app ... $ docker pull abtris/docker-liberec-example-app ... GDG Spaghetti Code Liberec, 6.10.2015 44


Слайд 44

Run on AWS $ docker run \ -d \ -p 3000:3000 \ abtris/docker-liberec-example-app \ node index.js $ curl http://localhost:3000 GDG Spaghetti Code Liberec, 6.10.2015 45


Слайд 45

Demo GDG Spaghetti Code Liberec, 6.10.2015 46


Слайд 46

Docker & AWS 4 Elastic Beanstalk 4 EC2 Container Service (ECS) 4 EC2 with Swarm, Mesos or Kubernetes GDG Spaghetti Code Liberec, 6.10.2015 47


Слайд 47

Questions? GDG Spaghetti Code Liberec, 6.10.2015 48


Слайд 48

Credits 4 boat-containers.jpg 2 4 computer-scrap.jpg [^3] 4 vm-vs-docker.png [^4] 4 docker logos [^5] 4 formule_one.jpg [^6] https://www.flickr.com/photos/41864721@N00/3451530961/ [^3]: https://www.flickr.com/photos/7362086@N02/2019666131/ [^4]: http://www.jayway.com/wp-content/uploads/2015/03/vm-vs-docker.png [^5]: https://www.docker.com/brand-guidelines 2 GDG Spaghetti Code Liberec, 6.10.2015 49


Слайд 49


×

HTML:





Ссылка: