So you set up a cool tool in a docker container but forgot to expose a /config
path and now all your setting are stored in the docker container and are not easy to back up. This note will guide you on transitioning your config files out of the container.
- Create a folder on the host machine
- Mount that folder to your docker container. Make sure you map it to a path that doesn't exist such as
/new-config
- Run
docker exit -it CONTAINER
to run shell commands in the container - Run
cp -r /config /new-config
to copy the files into our mounted folder - Now your files are outside of the container! You can now change the volume path mapping from
/new-config
to/config
🎉