lightweight git synchronisation
746
A Docker image that continuously synchronizes a Git repository subtree to a destination path using Go Task.
docker run -d \
-e GIT_REPO_URL="[email protected]:your/repo.git" \
-e GIT_SUBFOLDER_PATH="src" \
-v $HOME/.ssh:/ssh:ro \
-v /host/path/to/sync/to:/sync \
giraffacarp/gitsync
services:
gitsync:
image: giraffacarp/gitsync
environment:
GIT_REPO_URL: "[email protected]:your/repo.git"
GIT_SUBFOLDER_PATH: "src"
SYNC_INTERVAL: 30
volumes:
- data-sync:/sync
- $HOME/.ssh:/ssh:ro
volumes:
data-sync
-v $HOME/.ssh:/ssh:ro
-v $HOME/.ssh/id_rsa:/ssh/id_git:ro
-e GIT_SECRET_KEY="$(cat $HOME/.ssh/id_rse | base64)"
Note
Always mount SSH keys as read-only volumes
| Environment Variable | Description | Default |
|---|---|---|
GIT_HOST | Git server hostname | github.com |
GIT_REPO_URL | SSH URL of Git repository (required) | - |
GIT_SUBFOLDER_PATH | Subfolder path to sync | "" (root) |
GIT_SECRET_KEY | SSH key private key | "" |
GIT_BRANCH | Git branch to track | main |
SYNC_INTERVAL | Sync interval in seconds | 10 |
sync Perform single synchronizationwatch Continuous sync (default)/sync: Destination path for synchronized files/ssh: SSH configuration directoryContent type
Image
Digest
sha256:8d4b062b9…
Size
17.6 MB
Last updated
over 1 year ago
docker pull giraffacarp/gitsync