Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ -z "$KRSYNC_STARTED" ]; then
export KRSYNC_STARTED=true
exec rsync --blocking-io --rsh "$0" $@
fi
# Running as --rsh
namespace=''
pod=$1
apiVersion: v1
kind: Pod
metadata:
name: iat-dind
spec:
containers:
- name: iat-dind
image: docker:19.03-dind
securityContext:
privileged: true
@ET-Chan
ET-Chan / gist:c7fcd0c459c3c10845648cafd903f439
Last active April 23, 2020 09:12
Rsync directly into a docker container
#!/bin/bash
# This script is inspired by https://serverfault.com/questions/741670/rsync-files-to-a-kubernetes-pod
# It is especially useful when your docker daemon is running in remote server
if [ -z "$DRSYNC_STARTED" ]; then
export DRSYNC_STARTED=true
exec rsync --blocking-io --rsh "$0" "$@"
fi
# Running as --rsh