Reputation: 23
I have big problem with influxdb docker image. I want to save data, databases and tables to file, move file to another host and then restore container with full configuration and data. I tied:
1. docker save / load
2. docker export / import
3. docker commit / run
For influxdb official docker image commands above don't save changes... Everytime container was "clean" with only initial configuration. I have no idea what is wrong... command:
docker diff
only confirms that no changes was saved.
Thank You for Your time and answers.
Upvotes: 0
Views: 291
Reputation:
I tried to save some changes in the influxdb (commit) and starting a new container using the new Image created. Let me list down the steps I took:
In C2, When I checked the change that I made (~/testing123), I was able to see that it was present.
You might be using the same image. A new Image is created after the docker commit.
P.S.: Couldn't comment, that's why had to post it as an answer.
Upvotes: 0
Reputation: 39277
You need to mount volumes at database location:
docker run -p 8083:8083 -p 8086:8086 \
-v $PWD:/var/lib/influxdb \
influxdb
This will mount current location as bind mount to /var/lib/influxdb
in the container (this is where influxdb stores databases.) Then you can tarball the bind mount on docker host and move it to the new host.
Now To the problem:
InfluxDB's Dockerfile
declares /var/lib/influxdb
as a volume. Volumes are not affected with docker commit
.
VOLUME /var/lib/influxdb
Upvotes: 1