This file contains 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 | |
set -eo pipefail | |
container=$1 | |
image=$(docker inspect --format '{{.Config.Image}}' $container) | |
cmd=$(docker inspect --format '{{.Config.Cmd}}' $container) | |
if [[ $cmd == '<nil>' ]]; then cmd=''; fi | |
binds=$(docker inspect --format '{{.HostConfig.Binds}}' $container | sed "s/\[//; s/\]//") | |
if [[ $binds == '<nil>' ]]; then binds=''; fi | |
envs=$(docker inspect --format '{{.Config.Env}}' $container | sed "s/\[//; s/\]//") |