Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Docker Compose configuration to run MySQL 5.6 and MySQL 5.7 on one instance. Create /var/lib/mysql56-data & /var/lib/mysql57-data with root as the owner of these directories before running docker-compose up -d
version: '3'
services:
mysql56:
image: mysql:5.6
restart: unless-stopped
container_name: mysql56-container
ports:
- "127.0.0.1:3356:3306"
environment:
MYSQL_ROOT_PASSWORD: rootPassword
volumes:
- /var/lib/mysql56-data:/var/lib/mysql
mysql57:
image: mysql:5.7
restart: unless-stopped
container_name: mysql57-container
ports:
- "127.0.0.1:3357:3306"
environment:
MYSQL_ROOT_PASSWORD: rootPassword
volumes:
- /var/lib/mysql57-data:/var/lib/mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment