Skip to content

Commit 0b7aac6

Browse files
committed
Add script to update docker images to the latest versions
1 parent b1bbfb4 commit 0b7aac6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/update-docker-images.bash

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# This command finds all Dockerfile files in the current directory and its subdirectories,
5+
# extracts the image names and tags from the FROM statements in each file, filters, sorts,
6+
# and removes duplicates from the resulting list,
7+
# and finally pulls each image and tag from a Docker registry using the docker pull command.
8+
9+
pushd "$( dirname -- "${BASH_SOURCE[0]}")/.."
10+
11+
find . -type f -name Dockerfile -exec grep -Po 'FROM\s+\K\S+' {} \; | grep -F ':' | sort | uniq | xargs -n 1 docker pull
12+
13+
popd

0 commit comments

Comments
 (0)