docker for developers
play

Docker for Developers Michael Hrivnak Principal Software Engineer - - PowerPoint PPT Presentation

Docker for Developers Michael Hrivnak Principal Software Engineer - Red Hat Inc. @michael_hrivnak Docker is Popular Deployment gets most of the attention. 1 Developer 1 Laptop 3 Skills Exit Codes $ sudo docker run -it --rm centos:centos7


  1. Docker for Developers Michael Hrivnak Principal Software Engineer - Red Hat Inc. @michael_hrivnak

  2. Docker is Popular Deployment gets most of the attention.

  3. 1 Developer 1 Laptop

  4. 3 Skills

  5. Exit Codes $ sudo docker run -it --rm centos:centos7 true $ echo $? 0 $ sudo docker run -it --rm centos:centos7 false $ echo $? 1

  6. Bind Mounts $ mkdir foo && echo 'Hello, FOSDEM!' > foo/hello $ sudo docker run -it --rm -v /home/mhrivnak/foo:/foo centos:centos7 bash # cat /foo/hello Hello, FOSDEM!

  7. Links $ sudo docker run -d --name crane pulp/crane $ sudo docker ps CONTAINER ID IMAGE COMMAND PORTS NAMES 33e0e1d2b9ed pulp/crane "/usr/sbin/httpd -D F" 80/tcp crane $ sudo docker run -it --rm --link crane centos:centos7 bash [root@f33ce29ade3d /]# curl -i http:// crane /v1/_ping HTTP/1.1 200 OK Date: Fri, 29 Jan 2016 16:25:56 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Content-Length: 4 X-Docker-Registry-Standalone: True X-Docker-Registry-Version: 0.6.6 X-Docker-Registry-Config: common Content-Type: application/json

  8. Environment Variables $ sudo docker run -it --rm -e FOO=hello centos:centos7 bash [root@1d890689611a /]# env | grep FOO FOO=hello

  9. Basic Skills Bind Mounts ● Links ● Environment Variables ●

  10. Unit T ests Problem: Large T est Matrix Solution: Docker image for each combination

  11. Dockerfjle FROM centos:centos7 MAINTAINER Pulp Team <pulp-list@redhat.com> # Install dependencies RUN yum -y install epel-release && yum -y update && yum install -y python-flask \ python-pip python-mock python-nose python-coverage python-flake8 python-rhsm \ python-unittest2 && yum clean all # Setup RUN mkdir -p /var/lib/crane/metadata/ # Run tests CMD cd /code/ && python setup.py test

  12. Network T opologies client client router router client client AMQP Broker client client router router client client

  13. Simulate Load client A client P client I client client client

  14. DB State Reset Problem: Need to quickly reset database state Solution: Start a new container to reset state Optionally keep a pool of fresh containers ●

  15. Demo of Your App Containerizing your app is hard to do right Embrace doing it wrong!

  16. Make T ools MTA to capture sent emails ● Proxies ● Fake APIs ● Data Migration T est ●

  17. Next Steps http://docs.docker.com/linux/started/ ● Red Hat Registry ● https://registry.hub.docker.com/repos/fedora/ ●

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend