Alpine image with rsync, OpenSSH, and SSH key support.
556
A tiny Alpine-based image with rsync and OpenSSH client preinstalled, plus a helper prepare-ssh entrypoint that wires up your SSH key from environment variables at runtime. Ideal for GitLab CI/CD or any pipeline where you want to deploy via rsync over SSH without running apk add on every job.
rsync, openssh-client (no sudo/sshd)prepare-ssh sets up ~/.ssh from environment variables# .gitlab-ci.yml (example)
deploy:
stage: deploy
image: docker.io/grooveshaker/rsync-ssh:latest
variables:
# Optional: make first connect non-interactive
SSH_OPTIONS: "-o StrictHostKeyChecking=accept-new"
script:
- rsync -avz -e "ssh $SSH_OPTIONS" out/${RELEASE_NAME}/ ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_DIR}/releases/${RELEASE_NAME}/
- ssh $SSH_OPTIONS ${DEPLOY_USER}@${DEPLOY_HOST} "cd ${DEPLOY_DIR} && ln -sfn releases/${RELEASE_NAME} current"
- ssh $SSH_OPTIONS ${DEPLOY_USER}@${DEPLOY_HOST} "sudo systemctl restart ${APP_NAME}"
SSH_PRIVATE_KEY (required): the private key content (e.g., ed25519).DEPLOY_HOST (optional): used by ssh-keyscan to pre-populate known_hosts.DEPLOY_USER, DEPLOY_DIR, RELEASE_NAME, APP_NAME) are consumed by your CI script.prepare-ssh will:
~/.ssh with correct permissions$SSH_PRIVATE_KEY to ~/.ssh/id_ed25519ssh-keyscan -H "$DEPLOY_HOST" if providedexec "$@" to run your command (e.g., the CI shell)You can override the command at runtime:
docker run --rm -e SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519)" \
-e DEPLOY_HOST=example.com \
docker.io/grooveshaker/rsync-ssh:latest rsync --version
MIT. See source repository for the Dockerfile.
Content type
Image
Digest
sha256:b60dfdab4âĶ
Size
6 MB
Last updated
12 months ago
docker pull grooveshaker/rsync-ssh