Docker Community Forums

Share and learn in the Docker community.

Persistance of data-only container


(Letsgood) #1

Hi there, i have data-only container (mongodb-data) for my MongoDB container specified by this Dockerfile

FROM busybox:latest
MAINTAINER Tomas Herma
RUN mkdir -p /data/db
VOLUME /data/db
CMD ["true"]

the mongodb container is run by fleet by this command

docker run --rm --name mongodb -p 27017:27017 --volumes-from mongodb-data letsgood/mongodb

the problem is that from time to time is this container deleted and all data are lost and i cant figure it why? when i remove the data container by force

docker rm -f mongodb-data

nothing happend, fleet restart this container i quess and data are here. but after lets say 20 hours the data are lost…

anybody can help me with this? thx in advance

Tomas


(Sven Dowideit) #2

mmm, I’ve never seen this happen using Docker. I’d suggest you’ll need to turn on fleet and docker debug logging and see who’s done what.

docker logs mongodb-data and docker events, running when things are ok, may give you a timeframe too.


(Letsgood) #3

Hi,

docker logs mongodb-data

doesn’t output anything, maybe because mongodb-data is data-only container, which is used only when is needed…


(Sven Dowideit) #4

yeah, its a long shot, based on the fact that something very surprising is happening.

what do the other 2 show - the Docker daemon debug log should at least tell you if something asked it to remove the volume container.