Docker container doesn't write in amazon EBS volume

4

In amazon EC2-instance (Amazon Linux AMI 2015.03.0 x86_64 HVM) I mounted EBS volume to /data directory. Now, I have a docker container that I (sudo) run with -v /data:/data. This container creates some files in /data directory. The problem is that all these files are created in shadowed /data directory and not in EBS /data volume.

How to make docker to write into the mounted EBS volume instead, and why this strange behavior happens?

MikleB

Posted 2015-05-03T07:55:33.260

Reputation: 143

Answers

0

Had the same problem. It seems that restarting the docker daemon solves this problem. Otherwise, your files are just shadowed.

gilm

Posted 2015-05-03T07:55:33.260

Reputation: 116

What's the point of using Docker (at all) if you have to restart the daemon to add a volume? – user3467349 – 2015-12-04T06:19:50.847