1

I am using docker to have versioned database on my local dev environment (e.g. to be able to snapshot/revert db state). I need it due to nature of my work. I can not use transactions to achieve what I want [one of reasons - some of statements are DDL]

So, I have docker container with one large file (MySQL Inno db file)

If I change this file a little bit (like update row in table), and then commit container, new layer will be created, and size of this layer will be size of this huge file, even if only couple of bytes in file changed.

I understand it happens because for docker file is 'atomic' structure, if file is being modified its copy is created in new layer, and this layer is later included in image

Is there a way to change this behavior and to make Docker to store diffs on file level, e.g. if 10 bytes of 10 GiG file was changed, create layer with size smaller then 10 GiG?

Mb I can use some other storage engine? [which one?] I also not very bound to docker, so I can even switch to rkt, question is - do you guys think it can help? (mb image format is different and can store diffs on file content level)

andll
  • 319
  • 2
  • 8
  • 1
    you should put all that data in a volume, not in the container, see https://docs.docker.com/userguide/dockervolumes/ – user2915097 Oct 06 '15 at 21:08

0 Answers0