2. About me
● Backend engineer : Java, Python, Linux
● QNAP Container Station/Linux Station
https://www.linkedin.com/in/seterrychen
https://github.com/seterrychen
https://twitter.com/seterrychen
11. Container concept in software engineering
From : http://www.vccoaching.com/smarter-thinking/
http://pclosmag.com/html/Issues/201304/page08.html
OS Kernel
System libraries
Language runtime
Application code
Configuration
13. Linux Container (LXC)
OS Kernel
System
libraries
Language
runtime
Application
code
Configuration
System
libraries
Language
runtime
Application
code
Configuration
System
libraries
Language
runtime
Application
code
Configuration
System libraries
Language runtime
Application code
Configuration
15. Basic isolation of Linux
● chroot : A chroot on Unix operating systems is an operation that changes the
apparent root directory for the current running process and its children.
From : http://freedompenguin.com/articles/how-to/learning-the-linux-file-system/
17. Isolation of LXC
● Linux Kernel feature :
○ Namespaces
■ Mount namespaces
■ UTS namespaces
■ IPC namespaces
■ PID namespaces
■ Network namespaces
■ User namespaces
18. Tools of LXC
● lxc-create : download base rootfs and create a container
● lxc-start, lxc-stop … : control the container
● lxc-attach : start a process inside a running container
● lxc-ls : list all containers status
20. Pain point when using LXC (in my case)
● Install your application by script
● Deploy containers by manual
● No version control system/repositories to store containers you already install
application
From : http://icons.iconarchive.com/icons/babasse/imod/72/Tar-icon.png
Host 1 Host 2
container-v1.0 container-v2.0 container-v3.0 container-v1.0 container-v1.1
22. What is Docker ?
Docker is an open-source engine which automates the deployment of applications
as highly portable, self-sufficient containers.
(From : https://github.com/docker/docker/wiki/Docker-0.3.0-release-note,-May-6-2013)
32. Process inside container
my-nginx container
nginx: master process
nginx: worker process
PID 1
host
nginx: master process
nginx: worker process
PID 5566
40. Common questions
Q: Can skip the initialization of Container Station ?
A: Using system-docker
41. Common questions
Q: Why is a container suddenly closed after executing docker run ?
A: The PID 1 process inside container is closed. Please using bash replace the
default command to debug.
42. Common questions
Q: How to backup data of a container
A: Using docker run -v /host_path/backup:/container_path/data
43. Common questions
Q: At container, how to get information of NAS
A: Using docker -v /host/your_socket:/container/run.
Example : -v /etc/qbus:/etc/qbus -v /var/run/qbus.sock:/var/run/qbus.sock -v
/share/CACHEDEV2_DATA/.qpkg/container-station/usr/bin/.libs/qbus:/bin/qbus