Skip to content

Instantly share code, notes, and snippets.

@kisom
Created November 14, 2014 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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="kyle@tyrfingr.is"
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