Docker Compose
docker三剑客之一
# 下载1.25.0 docker compose sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose # 添加可执行权限 sudo chmod +x /usr/local/bin/docker-compose # 测试安装 sudo docker-compose --version #启动一个容器 docker-compose up -d #停止容器 docker-compose down
配置文件
docker-compose.yml
MySQL 8.x
version: '3.1'
services:
mysql8:
image: mysql:8.0.13
restart: always
environment:
MYSQL_ROOT_PASSWORD: 123456
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
ports:
- 3306:3306
volumes:
- ./data:/var/lib/mysql
adminer