2020-02-10 15:12:27 +01:00
|
|
|
#!/bin/bash
|
2020-02-10 19:23:17 +01:00
|
|
|
set -e
|
2019-10-31 15:22:12 +01:00
|
|
|
|
2020-02-10 19:23:17 +01:00
|
|
|
self=`realpath $0`
|
|
|
|
self_dir=`dirname "$self"`
|
2019-10-31 15:22:12 +01:00
|
|
|
|
2022-09-19 19:53:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
sub_images=""
|
|
|
|
for arg in "$@"; do
|
|
|
|
arg_sub_image=`echo "$arg" | sed 's/Dockerfile-//'`
|
|
|
|
NL=$'\n'
|
|
|
|
sub_images+="$NL$arg_sub_image"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
sub_images=`ls -1 Dockerfile-core* | sed 's/Dockerfile-//'`
|
|
|
|
sub_images="$sub_images `ls -1 Dockerfile-* | sed 's/Dockerfile-//'`"
|
|
|
|
fi
|
|
|
|
echo "Building:"
|
|
|
|
echo "$sub_images"
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
2022-08-23 18:48:44 +02:00
|
|
|
# Update base images if we build a core image
|
|
|
|
if echo "$sub_images" | grep -q core; then
|
2023-08-08 12:09:33 +02:00
|
|
|
docker pull ubuntu:22.04
|
|
|
|
docker pull nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
|
2022-08-23 18:48:44 +02:00
|
|
|
fi
|
|
|
|
|
2021-01-15 20:19:45 +01:00
|
|
|
for sub_image in $sub_images; do
|
2021-02-15 17:10:27 +01:00
|
|
|
docker build --cache-from=quratorspk/ocrd-galley-$sub_image -t quratorspk/ocrd-galley-$sub_image -f Dockerfile-$sub_image .
|
2021-01-15 20:19:45 +01:00
|
|
|
done
|