#!/usr/bin/bash read -r -d '' START << EOM FROM debian:latest RUN apt update -y EOM read -r -d '' END << EOM RUN apt-get clean autoclean RUN apt-get autoremove --yes RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ RUN useradd -m user USER user WORKDIR /home/user EOM cd langs for dir in */ do dir="${dir%*/}" if podman image exists "$dir-runner"; then continue fi template="$(cat $dir/Dockerfile)" echo "$START $template COPY $dir/run.sh /usr/bin/run RUN chmod +x /usr/bin/run RUN chmod 705 /usr/bin/run $END ENTRYPOINT [\"/usr/bin/run\"]" > Dockerfile podman build -t "$dir-runner" . rm Dockerfile done cd ..