Git commit docker volume content on file modified
10K+
This image was developed with the GeoServer configuration directory (aka the ill-named "datadir") in mind, but should prove useful in other cases too.
When the configuration is updated through GeoServer admin UI, several files are modified in the "datadir", and the updateSequence parameter (in file global.xml) is incremented.
This image fits perfectly the use case:
/var/local/data is committedExample usage:
sync:
image: fvanderbiest/volume-git-backup
environment:
WATCH_FILE: global.xml
GIT_COMMIT_MESSAGE: printf "updateSequence "; grep updateSequence global.xml|sed -e 's#.*ce>\(.*\)</up.*#\1#'
GIT_USERNAME: fvanderbiest
GIT_EMAIL: [email protected]
volumes:
- geoserver_datadir:/var/local/data:rw
If the additional REMOTE_URL, REMOTE_NAME & TOKEN environment variables are set, commits are pushed (--force) to the master branch of the given repository. WARNING: this might result in data loss !
More on https://github.com/fvanderbiest/docker-volume-git-backup
Content type
Image
Digest
Size
75.6 MB
Last updated
over 8 years ago
docker pull fvanderbiest/volume-git-backup