version: '3' services: db: #构建mysql镜像 image: mysql container_name: mysql-db # 容器名 restart: always environment: MYSQL_ROOT_PASSWORD: root #root管理员用户密码 MYSQL_USER: test #创建test用户 MYSQL_PASSWORD: test #设置test用户的密码 ports: - '3310:3306' volumes: - /tmp/docker/mysql/data/db:/var/lib/mysql - /tmp/docker/mysql/data/conf:/etc/mysql/conf.d
标签:inspect,db,IPADRESS,MYSQL,conf,mysql,test,docker From: https://www.cnblogs.com/SunshineKimi/p/16899324.html