Last active
October 19, 2017 08:00
-
-
Save heysamtexas/5a1edd8478b454832a848694e9bd7ff4 to your computer and use it in GitHub Desktop.
An excellent little one-liner to peek at your docker secrets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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