Reputation: 3393
I am new to docker. I want to run tinyproxy within docker. Here is the image I used to create a docker container: "https://hub.docker.com/r/dtgilles/tinyproxy/".
docker run -v $(pwd):/logs -p 8888:8888 -d --name tiny dtgilles/tinyproxy
Does anyone has any ideas about saving the changes in container?
Upvotes: 2
Views: 2591
Reputation: 3798
How to save a change committed by/into a container?
The command docker commit
creates a new image from a container's changes (from the man page).
You actually should not do this to save a configuration file. A Docker image is supposed to be immutable. This increases sharing, and image customization through mounted volume.
What you should do is create the configuration file on the host and share it at through parameters with docker run
. This is done by using the option -v|--volume
. Check the man page, you'll then be able to share files (or directories) between host and containers allowing to persists the data through different runs.
Upvotes: 1