- 安装(https://get.daocloud.io/)
curl -L https://get.daocloud.io/docker/compose/releases/download/1.15.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- 配置文件 docker-compose.yml
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 8080:80
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: example
- 启动
# 创建与启动
docker-compose up
# -f 指定配置文件名,默认docker-compose.yml
# 启动
docker-compose start
- 关闭
docker-compose stod
- 查询
docker-compose ps
- 删除
docker-compose down