rework all docker images to use debian slim

This commit is contained in:
Pau Capó 2023-11-26 13:08:01 +01:00
parent 9d5a6833ae
commit 62036249fd
10 changed files with 180 additions and 103 deletions

View file

@ -1,19 +1,31 @@
#!/bin/bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
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 dockerfile in $SCRIPT_DIR/*:*; do
package=`basename "$dockerfile"`
if [[ "$1" == "" || "$1" == "$package" ]]; then
echo "Building $package"
docker build \
-f "$dockerfile" \
-t "git.paucapo.com/server/$package" \
"$SCRIPT_DIR"
docker push "git.paucapo.com/server/$package"
fi
for PHP_VERSION in ${PHP_VERSIONS}; do
build ${PHP_VERSION} ${PHP_VERSION}
done
sudo docker image prune -a --force
for PHP_VERSION in ${WKHTML}; do
build "${PHP_VERSION}-wkhtml" "${PHP_VERSION}" "--build-arg WKHTML=1"
done
docker image prune -a --force