docker ata glance

18
Docker at a glance Philip Wang

Upload: philipwang

Post on 15-Jul-2015

210 views

Category:

Technology


1 download

TRANSCRIPT

Docker at a glance

Philip Wang

Agenda

• Docker introduction• Demo• Docker’s future

What is Docker

Build, Ship and Run

Any App, Anywhere

http://www.docker.io

Why Docker

The hell of the matrix

Static Website

Web frontend

Background Workers

User DB

Analytics DB

Queue

?? ?? ?? ?? ??

?? ?? ?? ?? ??

?? ?? ?? ?? ??

?? ?? ?? ?? ??

?? ?? ?? ?? ??

?? ?? ?? ?? ??

Why Docker

• Developers View• Operations View

Continuous Deployment

Technical overview of Docker

• Isolation – LXC – pid、 net、 ipc、mnt、 uts、 user

• cgroups (Control Groups)• AUFS (Another Union File System)

http://docs.docker.com/terms/image/

http://docs.docker.com/terms/filesystem/

http://docs.docker.com/terms/filesystem/image/

http://docs.docker.com/terms/image/

http://docs.docker.com/terms/container/

Docker commands

Docker commands

• docker run• docker ps• docker stop|start|restart• docker build• docker rm• docker rmi• docker logs

docker [OPTIONS] COMMAND [arg...]

Demo

• Build image• Run container• Ship container• Run container from another place

Library system•Java 7•Liferay 6.1•MySQL

Dockerfile# Build Liferay image

FROM prftgdcchina/liferay-6.1.2

MAINTAINER philip wang <[email protected]>

# Add the library system specific files

ADD Company_Logo1.png /liferay/tomcat-7.0.40/webapps/ROOT/html/themes/classic/images/

ADD libraryLogo /liferay/data/document_library/0/0/10647.jpg/1.0

ADD custom.css /liferay/tomcat-7.0.40/webapps/ROOT/html/themes/classic/css/

ADD portal-ext.properties /liferay/

# Add the library war file to the deploy folder

ADD Library-1.0-SNAPSHOT.war /liferay/deploy/

# Expose the ports

EXPOSE 8080

# Start liferay

CMD /bin/sh /liferay/tomcat-7.0.40/bin/startup.sh && tail -f /liferay/tomcat-7.0.40/logs/catalina.out

Docker Ecosystem

Docker’s future

• Core capabilities (libcontainer)• Cross service management (libswarm) • Messaging between containers (libchan)

Reference

• www.docker.io• www.infoq.com/cn/dockers/