kalilinux - rebuild when image version changes

This commit is contained in:
Bernhard Ehlers 2023-07-05 13:38:09 +02:00
parent eeaf9106fb
commit 128b642464
2 changed files with 17 additions and 1 deletions

View File

@ -93,5 +93,21 @@ jobs:
set -f
set -- $IMAGES
set +f
# get image version
get_image_version() {
docker buildx imagetools inspect --format '{{json .Image}}' "$1" | \
sed -n 's/^ *"org\.opencontainers\.image\.version": *"\([^"]*\).*/\1/p' | \
head -n 1
}
# special treatment for kalilinux: rebuild when image version changes
if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then
basever=$(get_image_version kalilinux/kali-last-release:amd64)
imagever=$(get_image_version gns3/kalilinux)
[ -z "$basever" ] || [ "$basever" = "$imagever" ] || \
set -- "$@" kalilinux
fi
# use option --dir to use a subdirectory as a docker base dir
python3 "$GITHUB_WORKSPACE/.github/bin/docker_build" --dir "docker" "$@"

View File

@ -1,4 +1,4 @@
FROM kalilinux/kali-rolling
FROM kalilinux/kali-last-release
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y tshark && apt-get install -y --no-install-recommends metasploit-framework nmap hydra sqlmap telnet openssh-client dnsutils yersinia ettercap-text-only cisco-global-exploiter cisco-auditing-tool snmp dsniff dnschef fping hping3 python3-scapy\
&& rm -rf /var/lib/apt/lists/*