djbobo
djbobo

Reputation: 547

How do I persist data in a QuestDB docker container?

I'm running QuestDB from the Docker image but when I stop it, the data is not persisted on restart:

docker run -p 9000:9000 -p 8812:8812 questdb/questdb

What's a good strategy for keeping the tables / records when restarting this?

Upvotes: 0

Views: 343

Answers (1)

Brian Smith
Brian Smith

Reputation: 1315

You can do this in a few ways, a convenient way is to give the container a name when you start it first:

docker run -p 9000:9000 -p 8812:8812 --name questdb-example questdb/questdb

When this image is stopped, you can bring it up again with the data persisted:

# bring the container up
docker start questdb-example
# shut the container down
docker stop questdb-example

Upvotes: 3

Related Questions