6. Container
• 利用命名空間來做權限的隔離控制、利用 cgroups
來做資源分配
• 獨立、安全的執行環境
– Isolated file system, network, process and block I/O space
• 包含這個 process 需要的東西
– filesystem, system libraries, shell…
A process in a box
+
Everything the process might need
26. Demo 1
• Search images from Docker Hub
• Pull image from Docker Hub
• Check Docker version and information
• Run a container from a image
• Commit a new image
• Create redis-server image
指令附在最後幾頁
27. Dockerfile
• 只是一個文字檔
– 可以當成文件用來溝通
– 可以進入版本控制系統
– 便於傳遞
• 可以透過 Docker Hub 綁定 Github,在使用
者提交後,自動建立新的 image。
# This is a nginx server
FROM ubuntu:12.04
MAINTAINER azole <azole@pchome.com.tw>
RUN apt-get -qq update
RUN apt-get -y install nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]