一、开启服务

  1. vi docker-compose.yml
  1. version: '3'
  2. services:
  3. mysql1:
  4. image: mysql
  5. environment:
  6. - MYSQL_ROOT_PASSWORD=123456
  7. ports:
  8. - 28002:3306
  9. mysql2:
  10. image: mysql
  11. environment:
  12. - MYSQL_ROOT_PASSWORD=123456
  13. ports:
  14. - 28003:3306
  1. docker-compose up -d

二、停止/删除服务

  1. docker-compose stop
  2. docker-compose rm