Skip to content

Instantly share code, notes, and snippets.

View Midnighter's full-sized avatar

Moritz E. Beber Midnighter

View GitHub Profile
@Midnighter
Midnighter / push_docker_volume.sh
Last active August 14, 2025 09:35
Push a local Docker volume to a remote host via SSH.
#!/usr/bin/env bash
set -euxo pipefail
host=${1?The first argument needs to be an SSH remote host.}
volume=${2?The second argument needs to be a Docker volume name.}
docker run --rm -v ${volume}:/from alpine ash -c \
'cd /from ; tar -cf - . ' | \
ssh ${host} \