Created
July 31, 2020 17:56
-
-
Save addeeandra/9823f7fe191b4d4c06714d6e14e24a26 to your computer and use it in GitHub Desktop.
Linux utility stuffs.
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 | |
GREEN='\033[1;32m' | |
WHITE='\033[1;38m' | |
NC='\033[0m' | |
# Getting common docker information | |
# - Container(s) information | |
# - Default Network (bridge) information | |
# - Available Images(s) information | |
echo '---------------------------------------------' | |
echo -e "${GREEN}Container(s) info${NC}${WHITE}\n$(docker ps --format='> {{.Names}} [{{.Ports}}]')${NC}" | |
echo -e "$(docker ps -f status=exited --format='> {{.Names}} [EXITED]')" | |
echo '---------------------------------------------' | |
echo -e "${GREEN}Network (bridge) info${NC}\n${WHITE}$(docker network inspect bridge --format='{{range .Containers}}> {{.IPv4Address}}\t{{.Name}}{{"\n" -}}{{end}}')${NC}" | |
echo '---------------------------------------------' | |
echo -e "${GREEN}Available image(s)${NC}\n${WHITE}$(docker images --format='[{{.ID}}] {{.Repository}}:{{.Tag}}')${NC}" | |
echo '---------------------------------------------' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment