#!/bin/bash PHP_VERSIONS="7.4 8.2" WKHTML="" SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) function build() { PACKAGE="php:$1" PHP_VERSION="$2" echo "Building ${PACKAGE}" docker build \ -f "${SCRIPT_DIR}/Dockerfile-php" \ -t "git.paucapo.com/server/${PACKAGE}" \ --build-arg PHP_VERSION=${PHP_VERSION} \ $3 \ "$SCRIPT_DIR" docker push "git.paucapo.com/server/${PACKAGE}" } docker login "http://git.paucapo.com/" for PHP_VERSION in ${PHP_VERSIONS}; do build ${PHP_VERSION} ${PHP_VERSION} done for PHP_VERSION in ${WKHTML}; do build "${PHP_VERSION}-wkhtml" "${PHP_VERSION}" "--build-arg WKHTML=1" done docker image prune -a --force