mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-18 02:17:46 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8b30b2363 | ||
|
|
22c8d5e423 | ||
|
|
05c7c8f0dd | ||
|
|
8ff701428b | ||
|
|
f740527595 | ||
|
|
5d5d7eaffe | ||
|
|
986de413fe | ||
|
|
c48b94cd7a | ||
|
|
270456c583 | ||
|
|
7b18a27834 | ||
|
|
c189f40842 | ||
|
|
7f182cddab | ||
|
|
9162ad2457 | ||
|
|
c635d03dbd |
13
README.md
13
README.md
@@ -1,13 +1,12 @@
|
|||||||
# dockcheck
|
# dockcheck
|
||||||
### A script checking updates for docker images **without the need of pulling** - then having the option to auto-update either all or selecting specific containers.
|
### A script checking updates for docker images **without the need of pulling** - then optionally auto-update chosen containers.
|
||||||
|
|
||||||
With the help of [`regctl`](https://github.com/regclient/regclient). This is just a concept for inspiration, use with care.
|
With the help of [`regctl`](https://github.com/regclient/regclient). This is just a concept for inspiration, use with care.
|
||||||
___
|
___
|
||||||
|
|
||||||
## Dependencies:
|
## Dependencies:
|
||||||
Running docker (duh) and compose, either standalone or plugin.
|
Running docker (duh) and compose, either standalone or plugin.
|
||||||
`regctl` by [regclient](https://github.com/regclient/regclient)
|
`regctl` by [regclient](https://github.com/regclient/regclient) (will ask to download `regctl` if not in `PATH` or `PWD`)
|
||||||
The script will ask to download `regctl` if it's not in PATH or current directory.
|
|
||||||
___
|
___
|
||||||
## `dockcheck.sh`
|
## `dockcheck.sh`
|
||||||
```bash
|
```bash
|
||||||
@@ -23,7 +22,7 @@ Options:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Basic example:
|
Basic example:
|
||||||
```bash
|
```bash
|
||||||
@@ -68,6 +67,8 @@ No updates installed, exiting
|
|||||||
- ~~Faulty registry checkups stopped the updates completely.~~
|
- ~~Faulty registry checkups stopped the updates completely.~~
|
||||||
- ~~No clear checks to skip containers producing errors.~~
|
- ~~No clear checks to skip containers producing errors.~~
|
||||||
- ~~Multi-digest images didn't correctly check with registry, giving false positives on updates.~~
|
- ~~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)~~
|
||||||
|
|
||||||
### :hammer: Known issues
|
### :hammer: Known issues
|
||||||
- ~~No granular choice of what to update (except initial name filter).~~
|
- ~~No granular choice of what to update (except initial name filter).~~
|
||||||
@@ -90,3 +91,7 @@ Updates available for local_nginx.
|
|||||||
nginx_reverse is already latest.
|
nginx_reverse is already latest.
|
||||||
Updates available for paperless-ng.
|
Updates available for paperless-ng.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Special Thanks:
|
||||||
|
:bison: [t0rnis](https://github.com/t0rnis)
|
||||||
|
:leopard: [Palleri](https://github.com/Palleri)
|
||||||
|
|||||||
15
dockcheck.sh
15
dockcheck.sh
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
### VERSION v.0.1.1
|
||||||
|
|
||||||
# Help Function:
|
### Help Function:
|
||||||
Help() {
|
Help() {
|
||||||
echo "Syntax: dockcheck.sh [OPTION] [part of name to filter]"
|
echo "Syntax: dockcheck.sh [OPTION] [part of name to filter]"
|
||||||
echo "Example: dockcheck.sh -a ng"
|
echo "Example: dockcheck.sh -a ng"
|
||||||
@@ -99,6 +100,12 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
### Sort arrays alphabetically
|
||||||
|
IFS=$'\n'
|
||||||
|
NoUpdates=($(sort <<<"${NoUpdates[*]}"))
|
||||||
|
GotUpdates=($(sort <<<"${GotUpdates[*]}"))
|
||||||
|
GotErrors=($(sort <<<"${GotErrors[*]}"))
|
||||||
|
unset IFS
|
||||||
### Create new Array to use for the numbered list:
|
### Create new Array to use for the numbered list:
|
||||||
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
||||||
|
|
||||||
@@ -128,9 +135,9 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
if [ "$UpdYes" != "${UpdYes#[Yy]}" ] ; then
|
if [ "$UpdYes" != "${UpdYes#[Yy]}" ] ; then
|
||||||
for i in "${SelectedUpdates[@]}"
|
for i in "${SelectedUpdates[@]}"
|
||||||
do
|
do
|
||||||
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.config_files"}}')
|
||||||
$DockerBin -f "$ContPath/docker-compose.yml" pull
|
$DockerBin -f "$ContPath" pull
|
||||||
$DockerBin -f "$ContPath/docker-compose.yml" up -d
|
$DockerBin -f "$ContPath" up -d
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
printf "\nNo updates installed, exiting.\n"
|
printf "\nNo updates installed, exiting.\n"
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
### VERSION v.0.1.1
|
||||||
|
|
||||||
### DOCKER RUN - VERSION
|
### DOCKER RUN - VERSION
|
||||||
|
|
||||||
### WARNING WONT REBUILD CONTAINERS - ONLY GRAB NEW IMAGES
|
### WARNING WONT REBUILD CONTAINERS - ONLY GRAB NEW IMAGES
|
||||||
### If running docker compose, use the main version. (recommended!)
|
### If running docker compose, use the main version. (recommended!)
|
||||||
|
|
||||||
# Help Function:
|
### Help Function:
|
||||||
Help() {
|
Help() {
|
||||||
echo "Syntax: dockcheck.sh [OPTION] [part of name to filter]"
|
echo "Syntax: dockcheck.sh [OPTION] [part of name to filter]"
|
||||||
echo "Example: dockcheck.sh -a ng"
|
echo "Example: dockcheck.sh -a ng"
|
||||||
@@ -104,6 +105,12 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
### Sort arrays alphabetically
|
||||||
|
IFS=$'\n'
|
||||||
|
NoUpdates=($(sort <<<"${NoUpdates[*]}"))
|
||||||
|
GotUpdates=($(sort <<<"${GotUpdates[*]}"))
|
||||||
|
GotErrors=($(sort <<<"${GotErrors[*]}"))
|
||||||
|
unset IFS
|
||||||
### Create new Array to use for the numbered list:
|
### Create new Array to use for the numbered list:
|
||||||
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
||||||
|
|
||||||
|
|||||||
BIN
example.gif
Normal file
BIN
example.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 510 KiB |
BIN
example_run.gif
BIN
example_run.gif
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB |
Reference in New Issue
Block a user