Last active
March 14, 2023 23:47
-
-
Save littlefuntik/951a17a39fec19b12d3d5ad34281c7aa to your computer and use it in GitHub Desktop.
Get runned docker container initial environments 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/sh | |
DOCKER_CONTAINER_NAME_OR_ID="$1" | |
if [[ ! $DOCKER_CONTAINER_NAME_OR_ID ]]; then | |
echo "First argument must be RUNNED(!) docker container name or ID." | |
exit 1 | |
fi | |
docker inspect -f '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' $DOCKER_CONTAINER_NAME_OR_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment