Skip to content

Instantly share code, notes, and snippets.

@jrmoserbaltimore
Last active December 11, 2016 21:32
Show Gist options
  • Save jrmoserbaltimore/d9d4b010613ff51a5ce9f43759573719 to your computer and use it in GitHub Desktop.
Save jrmoserbaltimore/d9d4b010613ff51a5ce9f43759573719 to your computer and use it in GitHub Desktop.
# Quick MariaDB container listening on localhost:3306
db:
image: mariadb:10.1
ports:
- localhost:3306:3306
volumes:
/opt/containers/mariadb/data/db:/var/lib/mysql
/opt/containers/mariadb/conf/mariadb/my.cnf:/etc/my.cnf:ro
restart: always
#!/bin/bash
apt-get install docker-compose docker.io
mkdir -p /opt/containers/mariadb/data/db
mkdir -p /opt/containers/mariadb/conf/mariadb
service mysql stop
rsync -avv /var/lib/mysql/ /opt/containers/mariadb/data/db/
cd /opt/containers/mariadb/
cp /tmp/docker-compose.yml .
cp /etc/my.cnf conf/mariadb/
docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment