mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-18 10:27:54 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e864edc40e | ||
|
|
aac065022c | ||
|
|
3e60468d47 | ||
|
|
09c1b769ca | ||
|
|
5392c48a57 | ||
|
|
cc72411de4 | ||
|
|
026d5296f8 |
27
README.md
27
README.md
@@ -1,6 +1,13 @@
|
|||||||
# dockcheck
|
# dockcheck
|
||||||
### A script checking updates for docker images **without pulling** - then selectively auto-update some/all containers.
|
### A script checking updates for docker images **without pulling** - then selectively auto-update some/all containers.
|
||||||
|
|
||||||
|
### :warning: URGENT!
|
||||||
|
The 2.0 change had a breaking error - compose-recreation might have included previous containers compose-file.
|
||||||
|
If you've had odd errors, you can use the [errorCheck.sh](https://github.com/mag37/dockcheck/blob/main/errorCheck.sh) script to list current running container configs in a readable way. Look especially for **Compose files** listed in wrong places.
|
||||||
|
Recreate the suspicious container(s) manually with `docker compose down && docker compose up -d`.
|
||||||
|
|
||||||
### :pushpin: Recent changes:
|
### :pushpin: Recent changes:
|
||||||
|
- **v0.2.2**: Fixed breaking errors with multi-compose, odd breakage and working dir error.
|
||||||
- **v0.2.1**: Added option to exclude a list of containers.
|
- **v0.2.1**: Added option to exclude a list of containers.
|
||||||
- **v0.2.1**: Added multi-compose support (eg. override).
|
- **v0.2.1**: Added multi-compose support (eg. override).
|
||||||
- **v0.2.0**: Fixed error with container:tag definition.
|
- **v0.2.0**: Fixed error with container:tag definition.
|
||||||
@@ -58,26 +65,6 @@ After the updates are complete, you'll get prompted if you'd like to prune dangl
|
|||||||
`docker run` dont support using new images just by restarting a container.
|
`docker run` dont support using new images just by restarting a container.
|
||||||
Containers need to be manually stopped, removed and created again to run on the new image.
|
Containers need to be manually stopped, removed and created again to run on the new image.
|
||||||
|
|
||||||
|
|
||||||
### :beetle: Squashed Bugs:
|
|
||||||
- ~~No options for running without updates or auto update.~~
|
|
||||||
- ~~No filter to check only specific containers.~~
|
|
||||||
- ~~Faulty registry checkups stopped the updates completely.~~
|
|
||||||
- ~~No clear checks to skip containers producing errors.~~
|
|
||||||
- ~~Multi-digest images didn't correctly check with registry, giving false positives on updates.~~
|
|
||||||
- ~~Not working with filenames other than `docker-compose.yml`~~
|
|
||||||
- ~~Lists are not alphabetically sorted (due to stacks and other parameters)~~
|
|
||||||
- ~~Old `docker-compose` binary-check sometimes returned false error~~
|
|
||||||
- ~~Stacks gets updated as whole, even if only one service is chosen.~~
|
|
||||||
- ~~Path broken occationally (from inspect) - probably due to old docker-compose binary.~~
|
|
||||||
- ~~Script breaks if one of the chosen containers are a `docker run` container.~~
|
|
||||||
- ~~Using relative paths for volumes eg. `${PWD}/data:data` will create the volumes where you stand.~~
|
|
||||||
- ~~Having no curl/wget leads to corrupt `regctl` without alerting.~~
|
|
||||||
- ~~Using custom `.env` files does not work.~~
|
|
||||||
- ~~Pull not respecting image:tags, always defaulting to latest~~
|
|
||||||
- ~~Not respecting multi-compose projects using multiple `-f` like `...override.yml` or similar.~~
|
|
||||||
- ~~Not being able to exclude specific containers.~~
|
|
||||||
|
|
||||||
### :hammer: Known issues
|
### :hammer: Known issues
|
||||||
- No detailed error feedback (just skip + list what's skipped) .
|
- No detailed error feedback (just skip + list what's skipped) .
|
||||||
- Not respecting `--profile` options when re-creating the container.
|
- Not respecting `--profile` options when re-creating the container.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
VERSION="v0.2.1"
|
VERSION="v0.2.2-URGENT"
|
||||||
Github="https://github.com/mag37/dockcheck"
|
Github="https://github.com/mag37/dockcheck"
|
||||||
|
|
||||||
### Check if there's a new release of the script:
|
### Check if there's a new release of the script:
|
||||||
@@ -158,6 +158,7 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
if [ "$UpdYes" == "${UpdYes#[Nn]}" ] ; then
|
if [ "$UpdYes" == "${UpdYes#[Nn]}" ] ; then
|
||||||
for i in "${SelectedUpdates[@]}"
|
for i in "${SelectedUpdates[@]}"
|
||||||
do
|
do
|
||||||
|
unset CompleteConfs
|
||||||
ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}')
|
ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}')
|
||||||
ContConfigFile=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}')
|
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" }}')
|
ContName=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.service" }}')
|
||||||
@@ -180,7 +181,7 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
ComposeFile="$ContPath/$ContConfigFile"
|
ComposeFile="$ContPath/$ContConfigFile"
|
||||||
fi
|
fi
|
||||||
### cd to the compose-file directory to account for people who use relative volumes, eg - ${PWD}/data:data
|
### cd to the compose-file directory to account for people who use relative volumes, eg - ${PWD}/data:data
|
||||||
cd "$(dirname "${ComposeFile}")" || { echo "Path error - skipping $i" ; continue ; }
|
cd "$ContPath" || { echo "Path error - skipping $i" ; continue ; }
|
||||||
docker pull "$ContImage"
|
docker pull "$ContImage"
|
||||||
### Reformat for multi-compose:
|
### Reformat for multi-compose:
|
||||||
IFS=',' read -r -a Confs <<< "$ContConfigFile" ; unset IFS
|
IFS=',' read -r -a Confs <<< "$ContConfigFile" ; unset IFS
|
||||||
|
|||||||
26
errorCheck.sh
Normal file
26
errorCheck.sh
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
SearchName="$1"
|
||||||
|
for i in $(docker 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}}')
|
||||||
|
|
||||||
|
if [[ $ContConfigFile = '/'* ]] ; then
|
||||||
|
ComposeFile="$ContConfigFile"
|
||||||
|
else
|
||||||
|
ComposeFile="$ContPath/$ContConfigFile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "Service name:\t\t$ContName"
|
||||||
|
echo -e "Project working dir:\t$ContPath"
|
||||||
|
echo -e "Compose files:\t\t$ComposeFile"
|
||||||
|
echo -e "Container image:\t$ContImage"
|
||||||
|
echo
|
||||||
|
echo "Mounts:"
|
||||||
|
docker inspect -f '{{ range .Mounts }}{{ .Source }}:{{ .Destination }}{{ printf "\n" }}{{ end }}' $i
|
||||||
|
echo
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user