You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
self=`realpath $0`
|
|
|
|
self_dir=`dirname "$self"`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
# Update base images if we build a core image
|
|
|
|
if echo "$sub_images" | grep -q core; then
|
|
|
|
docker pull ubuntu:22.04
|
|
|
|
docker pull nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
|
|
|
|
fi
|
|
|
|
|
|
|
|
for sub_image in $sub_images; do
|
|
|
|
docker build --cache-from=quratorspk/ocrd-galley-$sub_image -t quratorspk/ocrd-galley-$sub_image -f Dockerfile-$sub_image .
|
|
|
|
done
|