Created
June 8, 2018 08:18
-
-
Save askalee/616d9696b53deb14100bf35168601973 to your computer and use it in GitHub Desktop.
Get docker container environment variables
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
#!/bin/bash | |
containerName=$1 | |
echo "containerName: $containerName" | |
if [ "$containerName" == "" ]; then | |
echo "USAGE: $0 containerName" | |
echo " containerName: id or name" | |
exit 1 | |
fi | |
docker inspect -f \ | |
'{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' \ | |
$containerName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment