docker ata glance
TRANSCRIPT
Why Docker
The hell of the matrix
Static Website
Web frontend
Background Workers
User DB
Analytics DB
Queue
?? ?? ?? ?? ??
?? ?? ?? ?? ??
?? ?? ?? ?? ??
?? ?? ?? ?? ??
?? ?? ?? ?? ??
?? ?? ?? ?? ??
Technical overview of Docker
• Isolation – LXC – pid、 net、 ipc、mnt、 uts、 user
• cgroups (Control Groups)• AUFS (Another Union File System)
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’s future
• Core capabilities (libcontainer)• Cross service management (libswarm) • Messaging between containers (libchan)
Reference
• www.docker.io• www.infoq.com/cn/dockers/