mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-28 22:20:35 +01:00
Podcheck Initial Release
This commit is contained in:
parent
0009adc2cf
commit
61a38ad6c1
8 changed files with 213 additions and 193 deletions
|
|
@ -15,14 +15,14 @@ IFS=',' read -r -a Excludes <<< "$Exclude" ; unset IFS
|
|||
|
||||
SearchName="$1"
|
||||
|
||||
for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
||||
for i in $(podman ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
||||
for e in "${Excludes[@]}" ; do [[ "$i" == "$e" ]] && continue 2 ; done
|
||||
printf ". "
|
||||
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}')
|
||||
RepoUrl=$(podman inspect "$i" --format='{{.ImageName}}')
|
||||
LocalHash=$(podman image inspect "$RepoUrl" --format '{{.Digest}}')
|
||||
### Checking for errors while setting the variable:
|
||||
if RegHash=$($regbin image digest --list "$RepoUrl" 2>/dev/null) ; then
|
||||
if [[ "$LocalHash" = *"$RegHash"* ]] ; then NoUpdates+=("$i"); else GotUpdates+=("$i"); fi
|
||||
if [[ "$LocalHash" == "$RegHash" ]] ; then NoUpdates+=("$i"); else GotUpdates+=("$i"); fi
|
||||
else
|
||||
GotErrors+=("$i")
|
||||
fi
|
||||
|
|
@ -41,7 +41,7 @@ if [[ -n ${NoUpdates[*]} ]] ; then
|
|||
printf "%s\n" "${NoUpdates[@]}"
|
||||
fi
|
||||
if [[ -n ${GotErrors[*]} ]] ; then
|
||||
printf "\n\033[0;31mContainers with errors, wont get updated:\033[0m\n"
|
||||
printf "\n\033[0;31mContainers with errors; won't get updated:\033[0m\n"
|
||||
printf "%s\n" "${GotErrors[@]}"
|
||||
fi
|
||||
if [[ -n ${GotUpdates[*]} ]] ; then
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
|
|
@ -1,13 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
SearchName="$1"
|
||||
for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
||||
for i in $(podman ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
||||
echo "------------ $i ------------"
|
||||
ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}')
|
||||
[ -z "$ContPath" ] && { "$i has no compose labels - skipping" ; continue ; }
|
||||
ContConfigFile=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}')
|
||||
ContName=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.service" }}')
|
||||
ContEnv=$(docker inspect "$i" --format '{{index .Config.Labels "com.docker.compose.project.environment_file" }}')
|
||||
ContImage=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||
ContPath=$(podman inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}')
|
||||
if [ -z "$ContPath" ]; then
|
||||
echo "$i has no compose labels - skipping"
|
||||
continue
|
||||
fi
|
||||
ContConfigFile=$(podman inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}')
|
||||
ContName=$(podman inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.service" }}')
|
||||
ContEnv=$(podman inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.environment_file" }}')
|
||||
ContImage=$(podman inspect "$i" --format='{{.ImageName}}')
|
||||
|
||||
if [[ $ContConfigFile = '/'* ]] ; then
|
||||
ComposeFile="$ContConfigFile"
|
||||
|
|
@ -22,6 +25,6 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
|||
echo -e "Container image:\t$ContImage"
|
||||
echo
|
||||
echo "Mounts:"
|
||||
docker inspect -f '{{ range .Mounts }}{{ .Source }}:{{ .Destination }}{{ printf "\n" }}{{ end }}' "$i"
|
||||
podman inspect -f '{{ range .Mounts }}{{ .Source }}:{{ .Destination }}{{ printf "\n" }}{{ end }}' "$i"
|
||||
echo
|
||||
done
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 472 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 404 KiB |
BIN
extras/podcheck.png
Normal file
BIN
extras/podcheck.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 302 KiB |
Loading…
Add table
Add a link
Reference in a new issue