17
Jason Shepherd, Docker Meetup Brisbane What is Docker?

Introduction to Docker

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

What is Docker?

Page 2: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Lightweight container

Storage for containers

Images for building containers

Repository for images

Page 3: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Why Docker?

Page 4: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Page 5: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Make the entire lifecycle more efficient, consistent, and repeatable

Eliminate inconsistencies between

environments

Address significant performance, costs, deployment, and portability issues normally

associated with VMs

Page 6: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Demo: Creating a container

Page 7: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

sudo docker run -i -t fedora /bin/bashbash-4.2#

Run /bin/bash using the fedora image and use my current shell to access it.

Page 8: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Show the running containers

sudo docker ps

CONTAINER ID IMAGE COMMAND eed6e1011af4 fedora:20 /bin/bash

Page 9: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Demo: Saving your changes

Page 10: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

sudo docker run -i -t fedora /bin/bashbash-4.2# yum install -y httpdbash-4.2# exit

sudo docker run -i -t fedora /bin/bashbash-4.2# rpm -ql httpdPackage httpd is not installed

Page 11: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

sudo docker ps CONTAINER ID IMAGE COMMAND

123e61a0108d fedora:20 /bin/bash

sudo docker commit 123e61a0108d fedora-local8a4a4c6445b...

sudo docker imagesREPOSITORY TAG IMAGE

fedora-local latest 8a4a4c64495b

Page 12: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Demo:Access a container via the Network

Page 13: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Run Apache in the forground:/usr/sbin/httpd

-DFOREGROUND

Page 14: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Bind a port on the host(8080) to a container port(80)

sudo docker run -p 0.0.0.0:8080:80 -t a0cd983109bc /usr/sbin/httpd -DFOREGROUND

Page 15: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Hit it with your browser:

http://localhost:8080/

Page 16: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

Docker is not production ready:

- All system calls available- Can mount file system of host

- Can access process of container from host

Page 17: Introduction to Docker

Jason Shepherd, Docker Meetup Brisbane

How to deal with Security issues:

- Treat docker as you would sudo- Trust the images you run, they have root access

- Don't allow remote access to docker!