Skip to content

Instantly share code, notes, and snippets.

@kisom
Created November 14, 2014 17:34
Show Gist options
  • Save kisom/210f57a5c3b26d4861be to your computer and use it in GitHub Desktop.
Save kisom/210f57a5c3b26d4861be to your computer and use it in GitHub Desktop.
Export a container to a GPG-encrypted tarball.
#!/bin/sh
CONTAINER="$1"
BASENAME="$2"
OWNER="[email protected]"
if [ -z "$BASENAME" ]
then
echo "No basename provided."
exit
elif [ -z "$CONTAINER" ]
then
echo "No container name provided."
exit
fi
echo
docker export $CONTAINER | gzip - | gpg -o ${BASENAME}.tgz.gpg -r $OWNER -e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment