Docker Compose Started

安装Docker

参考链接:https://docs.docker.com/install/linux/docker-ce/ubuntu/

安装Docker Compose

Docker Compose可以作为一个Docker Container来运行,安装参考链接:https://docs.docker.com/compose/install/#install-as-a-container

常用命令

# 用户加入到docker组,可以非root用户启动
sudo usermod -a -G docker $USER
# 启动
docker-compose up # 启动,可看日志,但结束后服务停止
docker-compose up -d # 启动,不能看日志,后台运行
# 进入容器
docker-compose exec $service-name bash

Leave a Reply

Your email address will not be published. Required fields are marked *