审核中~
溜忙之道
首页
溜忙手册
offer之道
项目Git
写文章
登录
·
注册
登录
没有账号,去注册
注册
已有账号,去登录
博客
docker-compose 命令详解
南易_站长
阅读量:8388
关注
docker-compose 命令详解
## 镜像加速 鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决,我使用的是网易的镜像地址:http://hub-mirror.c.163.com。 在任务栏点击 Docker for mac 应用图标 -> Perferences... -> Daemon -> Registry mirrors。在列表中填写加速器地址即可。修改完成之后,点击 Apply & Restart 按钮,Docker 就会重启并应用配置的镜像地址了。 1.docker-compose的使用非常类似于docker命令的使用,**但是需要注意的是大部分的compose命令都需要到docker-compose.yml文件所在的目录下才能执行。** 2.【Linux命令】docker-compose up【命令解释】 命令聚合每个容器的输出,命令退出时,所有容器都将停止。 3.【Linux命令】docker-compose up -d【命令解释】 在后台启动容器并使它们保持运行。 4.【Linux命令】docker-compose logs -f【命令解释】 查看该容器的启动的日志打印(日志从头打印)。 5.【Linux命令】docker logs -f container_id【命令解释】 查看某一容器的启动的日志打印(日志从头打印)。 6.【Linux命令】docker logs -f --tail 数量词 container_id【命令解释】 查看某一容器的启动的日志打印(查看最后n条日志打印)。 例:docker logs -f --tail 50 44b 7.【Linux命令】docker-compose stop【命令解释】 停止compose服务。 8.【Linux命令】docker-compose restart【命令解释】 重启compose服务。 9.【Linux命令】docker-compose kill【命令解释】 kill compose服务。 10.【Linux命令】docker-compose ps【命令解释】查看compose服务状态。 11.【Linux命令】docker-compose rm【命令解释】删除compose服务。
评论
表情
发送
0
评论