# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
trying/nginx-com v1 ec2f0106598a 21 minutes ago 401 MB
centos latest 36540f359ca3 13 days ago 193 MB
查看容器:
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eac73ff1bbef trying/nginx-com:v1 "nginx" 22 minutes ago Up 22 minutes 0.0.0.0:80->80/tcp web-compose
查看服务状态(另一台主机上使用curl):
# curl 192.168.60.18
this is Compose test!
查看宿主机日志:
# cat log/access.log
192.168.60.19 - - [19/Jul/2017:05:16:38 +0000] "GET / HTTP/1.1" 200 29 "-" "curl/7.29.0" "-"
Dockerfile和docer compose支持的参数远不止这些。
更多Docker相关教程见以下内容:
在 Ubuntu 15.04 上如何安装Docker及基本用法