Skip to content

Instantly share code, notes, and snippets.

@heysamtexas
Last active October 19, 2017 08:00
Show Gist options
  • Save heysamtexas/5a1edd8478b454832a848694e9bd7ff4 to your computer and use it in GitHub Desktop.
Save heysamtexas/5a1edd8478b454832a848694e9bd7ff4 to your computer and use it in GitHub Desktop.
An excellent little one-liner to peek at your docker secrets
# this is a little "one-liner" to peek at all my docker secrets.
# I use this on development and test machines when debugging
echo ""
echo "-------------------------"
echo "Peek at docker secrets..."
echo "-------------------------"
docker service create --name peeker \
$(docker secret ls | sed '1d'| awk '{print "--secret " $2}'|sort -k2|xargs echo) busybox \
sh -c 'for i in `ls /run/secrets/*`; do echo "$(basename $i): $(cat $i)"; done' > /dev/null 2>&1 && \
sleep 3 && \
docker service logs peeker| awk '{print $3, $4}' && \
docker service rm peeker > /dev/null 2>&1
echo "-------------------------"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment