Skip to content
This repository was archived by the owner on Dec 1, 2018. It is now read-only.

Add example on how to keep the DB#54

Open
TLyngeJ wants to merge 1 commit into
lmakarov:masterfrom
TLyngeJ:master
Open

Add example on how to keep the DB#54
TLyngeJ wants to merge 1 commit into
lmakarov:masterfrom
TLyngeJ:master

Conversation

@TLyngeJ

@TLyngeJ TLyngeJ commented Aug 28, 2015

Copy link
Copy Markdown

If the container is killed, the DB usually goes the same way. This example show how to keep the data even is the container dies.

If the container is killed, the DB usually goes the same way. This example show how to keep the data even is the container dies.
@achekulaev

Copy link
Copy Markdown
Contributor

@lmakarov looks like nice to have

@lmakarov

lmakarov commented Sep 1, 2015

Copy link
Copy Markdown
Owner

This would only make sense on Linux. On Mac and Windows (via boot2docker) /var/lib/mysql would be effectively mounted over NFS/SMB, which would make performance painfully slow.

@TLyngeJ can you please explain your use case? What would be the benefit of making /var/lib/mysql persist even after the DB container is completely removed?

@TLyngeJ

TLyngeJ commented Sep 2, 2015

Copy link
Copy Markdown
Author

The use case is, that sometimes you'll need to update the container, but won't like to spend the 30 minutes, it sometimes takes to import databases.

And the purpose of this change is more to make people aware that it can be done, not enabling it by default. A comment could also make people aware of that this shouldn't be done, if you're running docker through a VM.

@fuzzbomb

Copy link
Copy Markdown
Contributor

@TLyngeJ There's a typo in a comment.

Uncomment the followinf line => Uncomment the following line

@james-nesbitt

Copy link
Copy Markdown

RE: persistant data:

consider snapshotting dbs by "docker commit" to a new image tag? images are exportable and distributable, but commited images are big. Requires that you don't use "VOLUME /var/lib/mysql"

@achekulaev

Copy link
Copy Markdown
Contributor

@james-nesbitt this would mean no updates to container

@kyleskrinak

kyleskrinak commented May 27, 2016

Copy link
Copy Markdown

This aspect — losing a database on a container rebuild — came up in my Drude presentation to a TriDUG meetup. Excuse my weak docker knowledge, but could you use a container solely dedicated as a persistent storage volume for the mysql data?

@james-nesbitt

james-nesbitt commented Jun 1, 2016

Copy link
Copy Markdown

@achekulaev yeah good point. (you couldn't update the db base image without significant effort, if you kept a versioned db image with content)

@kyleskrinak a versioned volume container is a good idea. It of course needs db image version pinning to be considered at the application layer, for cases where the /var/lib/mysql would be invalid with a newer db version. That would really suck for testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants