Saving your configuration changes ¶
To save any configuration changes you make when using the products in the stack, you must set up a local Docker volume to persist state and data for the stack. If you don't do this, whenever you bring the stack down, your configuration changes will be lost.
Mount a Docker volume location to the Docker
/opt/out directory for the container. The location must be to a directory you haven't already created. Our Docker containers use the
/opt/out directory to store application data.
Mounting to /opt/out
Make sure the local directory isn't already created. Docker needs to create this directory for the mount to
You can mount a Docker volume for containers in a stack or for standalone containers.
Bind mounting for a stack ¶
- Add a
volumessection under the container entry for each product in the
docker-compose.yamlfile you're using for the stack.
volumessection, add a location to persist your data. For example:
pingfederate: . . . volumes: - /tmp/compose/pingfederate_1:/opt/out
environmentsection, comment out the
The container then uses your
volumesentry to supply the product state and data, including your configuration changes.
When the container starts, this mounts
/opt/outdirectory in the container. You can also view the product logs and data in the
Repeat this process for the remaining container entries in the stack.
Bind mounting for a standalone container ¶
volume entry to the
docker run command:
docker run \ --name pingfederate \ --volume <local-path>:/opt/out \ pingidentity/pingfederate:edge
Getting started with Docker Compose mounts ¶
Within many of the docker-compose.yaml files in the Getting-Started repository, volume mounts to
opt/out have been included to persist your configuration across container restarts.
To view the list of persisted volumes, enter:
docker volume list
To view the contents of the /opt/out/ volume when the container is running, enter:
docker container exec -it <container id> sh cd out
To view the contents of the /opt/out/ volume when the container is stopped, enter:
docker run --rm -i -v=<volume name>:/opt/out alpine ls
To remove a volume, enter:
docker volume rm <volume name>
To copy files from the container to your local filesystem, enter:
docker cp \ <container id>:<source path> \ <destination path> eg. docker cp \ b867054293a1:/opt/out \ ~/pingfederate/
To copy files from your local filesystem to the container, enter:
docker cp \ <source path> \ <container id>:<destination path> eg. docker cp \ myconnector.jar \ bb867054293a186:/opt/out/instance/server/default/deploy/