minor: read Dockerfile from stdin

This commit is contained in:
Kévin Dunglas 2023-08-22 10:39:25 +02:00 committed by Jerry Ma
parent 3e7ef49bde
commit cf35a270bb

View File

@ -52,7 +52,7 @@ fi
# Detect docker env is setup
if ! $DOCKER_EXECUTABLE images | grep -q cwcc-spc-$SPC_USE_ARCH; then
echo "Docker container does not exist. Building docker image ..."
ALPINE_DOCKERFILE=$(cat << EOF
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH -f- . <<EOF
FROM $ALPINE_FROM
$SPC_USE_MIRROR
RUN apk update
@ -63,13 +63,8 @@ WORKDIR /app
ADD ./src /app/src
ADD ./composer.json /app/composer.json
ADD ./bin /app/bin
RUN composer update --no-dev
RUN composer update --no-dev --classmap-authoritative
EOF
)
echo "$ALPINE_DOCKERFILE" > "$(pwd)"/Dockerfile
$DOCKER_EXECUTABLE build -t cwcc-spc-$SPC_USE_ARCH .
rm "$(pwd)"/Dockerfile
fi
# Check if in ci (local terminal can execute with -it)