I have this app trying to orchestrate using docker + fig which works great for the first day of trying. It uses a data container where I want to persist my database files and a redis + mysql container(s) used by the app.
Once booted up the mysql container looks inside /var/lib/mysql
for data files and, if none found, it creates the default sb which I can then populate and the files are created and also persisted in my data volume.
While I'm learning fig I had to do a fig rm --force mysql
which deleted my mysql container. I did this without fear knowing that my data is safe on the data container. Running a ls
on my host shows the mysql files still intact.
The problem occurs when I run fig up
again which creates the mysql container again. Even though I have the same volumes shared and my old mysql files are still present this new container creates a new database as if the volume shared was empty. This only occurs if I rm
the container and not if I close fig and bring it back up.
Here's my fig file if it helps:
data:
image: ubuntu:12.04
volumes:
- /data/mysql:/var/lib/mysql
redis:
image: redis:latest
mysql:
image: mysql:latest
ports:
- 3306
environment:
MYSQL_DATABASE: *****
MYSQL_ROOT_PASSWORD: *****
volumes_from:
- data
web:
build: .
dns: 8.8.8.8
command: python manage.py runserver 0.0.0.0:8000
environment:
- DEBUG=True
- PYTHONUNBUFFERED=1
volumes:
- .:/code
ports:
- "8000:8000"
links:
- data
- mysql
- redis
Any ideas why the new mysql container won't use the existing files.?