1.首先需要安装dockercompose

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

2.在某个目录下创建文件 docker-compose.yml 其内容如下:

# yaml 配置实例
version: '3'
services:
  redis:
    image: redis:latest
  web:
    image: registry.cn-hangzhou.aliyuncs.com/seven-tao/simple-docker:0.0.6
    ports:
      - "9091:4050"
    volumes:
      - /tmp/simple-docker/back:/tmp/back
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      - redis
docker-compose up -d # 后台运行
浏览器访问 http://localhost:9091
默认账号: admin 默认密码: 123456