Skip to content

Commit bc8e0f7

Browse files
committed
WIP fix tests
1 parent 1cc5374 commit bc8e0f7

File tree

11 files changed

+115
-44
lines changed

11 files changed

+115
-44
lines changed

.github/workflows/workflow.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
php_version: ['8.1','8.0','7.4', '7.3','7.2']
18+
php_version: ['8.0'] #['8.1','8.0','7.4', '7.3','7.2']
1919
variant: ['apache','cli','fpm']
20-
builder: [ {arch: "amd64", os: "ubuntu-latest"}, {arch: "arm64", os: "macos-latest"}]
21-
# builder: [ {arch: "amd64", os: "self-hosted"}, {arch: "arm64", os: "self-hosted"}]
20+
# builder: [ {arch: "amd64", os: "ubuntu-latest"}, {arch: "arm64", os: "macos-latest"}]
21+
builder: [ {arch: "amd64", os: "ubuntu-latest"}, {arch: "arm64", os: "ubuntu-latest"}]
2222
runs-on: ${{ matrix.builder.os }}
2323
# runs-on: self-hosted
2424
name: Build & test ${{ matrix.php_version }}-${{ matrix.variant }} (${{ matrix.builder.arch }})
@@ -34,20 +34,29 @@ jobs:
3434
uses: docker/setup-qemu-action@v2
3535
- name: Set up Docker Buildx
3636
uses: docker/setup-buildx-action@v2
37-
- name: Expose GitHub Runtime for docker cache
38-
uses: crazy-max/ghaction-github-runtime@v2
3937
- name: Build
4038
run: |
4139
PHP_VERSION="${{ matrix.php_version }}"
42-
TAG_PREFIX="rc-${{ env.GITHUB_SHA_SHORT }}-" \
40+
TAG_PREFIX="rc${GITHUB_SHA::7}-" \
4341
docker buildx bake \
4442
--set "*.platform=linux/${{ matrix.builder.arch }}" \
4543
--set "*.output=type=docker" \
44+
--load \
4645
php${PHP_VERSION//.}-${{ matrix.variant }}-all
46+
- name: Display images built
47+
run: |
48+
echo "display all"
49+
docker image ls --format "{{.CreatedSince}}\t{{.Size}}\t{{.Repository}}:{{.Tag}}"
50+
echo "display filtered"
51+
docker image ls --filter="reference=thecodingmachine/php:rc-${GITHUB_SHA::7}-*" --format "{{.CreatedSince}}\t{{.Size}}\t{{.Repository}}:{{.Tag}}"
4752
- name: Test
4853
run: |
49-
TAG_PREFIX="rc-${{ env.GITHUB_SHA_SHORT }}-" \
50-
PHP_VERSION="${{ matrix.php_version }}" BRANCH=v4 VARIANT=${{ matrix.variant }} PLATFORM=linux/${{ matrix.builder.arch }} ./tests-suite/bash_unit -f tap ./tests-suite/*.sh
54+
TAG_PREFIX="rc${GITHUB_SHA::7}-" \
55+
PHP_VERSION="${{ matrix.php_version }}" \
56+
BRANCH="v4" \
57+
VARIANT="${{ matrix.variant }}" \
58+
PLATFORM="linux/${{ matrix.builder.arch }}" \
59+
./tests-suite/bash_unit -f tap ./tests-suite/*.sh
5160
5261
publish:
5362
# push ~ schedule
@@ -59,36 +68,32 @@ jobs:
5968
strategy:
6069
fail-fast: false
6170
matrix:
62-
php_version: ['8.1'] #,'8.0','7.4', '7.3','7.2']
63-
variant: ['apache'] #,'cli','fpm']
71+
php_version: ['7.2'] #['8.1','8.0','7.4', '7.3','7.2']
72+
variant: ['fpm'] #['apache','cli','fpm']
6473
steps:
6574
- name: Checkout
6675
uses: actions/checkout@v3
6776
- name: Set up QEMU
6877
uses: docker/setup-qemu-action@v2
6978
- name: Set up Docker Buildx
7079
uses: docker/setup-buildx-action@v2
71-
- name: Expose GitHub Runtime for docker cache
72-
uses: crazy-max/ghaction-github-runtime@v2
7380
- name: Login to DockerHub
7481
uses: docker/login-action@v1
7582
with:
7683
username: ${{ secrets.DOCKERHUB_USERNAME }}
7784
password: ${{ secrets.DOCKERHUB_TOKEN }}
7885
- name: Build and push ${{ matrix.php_version }}-${{ matrix.variant }} as multiarch (amd64 and arm64)
7986
run: |
80-
TAG_PREFIX="rc-${{ env.GITHUB_SHA_SHORT }}-" \
87+
TAG_PREFIX="rc${GITHUB_SHA::7}-" \
8188
docker buildx bake \
82-
--set "*.cache-from=type=gha" \
8389
--set "*.platform=linux/amd64,linux/arm64" \
8490
--set "*.output=type=registry" \
8591
php${PHP_VERSION//.}-slim-${{ matrix.variant }}
86-
PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:rc-${{ env.GITHUB_SHA_SHORT }}-${{ matrix.php_version }}-v4-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
92+
PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:rc-${GITHUB_SHA::7}-${{ matrix.php_version }}-v4-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
8793
PHP_VERSION="${{ matrix.php_version }}"
88-
TAG_PREFIX="rc-${{ env.GITHUB_SHA_SHORT }}-" \
89-
PHP_PATCH_MINOR="${{ env.PHP_VERSION_MINOR }}" \
94+
TAG_PREFIX="rc-${GITHUB_SHA::7}-" \
95+
PHP_PATCH_MINOR="${PHP_VERSION_MINOR}" \
9096
docker buildx bake \
91-
--set "*.cache-from=gha" \
9297
--set "*.platform=linux/amd64,linux/arm64" \
9398
--set "*.output=type=registry" \
9499
php${PHP_VERSION//.}-${{ matrix.variant }}-all

Dockerfile.slim.apache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ EXPOSE 80
211211

212212
ENV APACHE_DOCUMENT_ROOT=
213213

214-
RUN sed -ri -e "s!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf && \
215-
sed -ri -e "s!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
214+
RUN sed -ri -e 's!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
215+
sed -ri -e 's!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
216216

217217
# Let's remove the default Apache php.ini file (it will be copied from TEMPLATE_PHP_INI)
218218
RUN rm /etc/php/${PHP_VERSION}/apache2/php.ini
@@ -395,6 +395,7 @@ ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \
395395
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
396396
sudo apt-get update && \
397397
sudo apt-get install -y --no-install-recommends yarn && \
398+
if [[ "${NODE_VERSION}" == "10" ]]; then npm install -g npm@^6.14; else npm install -g npm; fi && \
398399
sudo apt-get clean && \
399400
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; \
400401
fi;

Dockerfile.slim.cli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \
300300
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
301301
sudo apt-get update && \
302302
sudo apt-get install -y --no-install-recommends yarn && \
303+
if [[ "${NODE_VERSION}" == "10" ]]; then npm install -g npm@^6.14; else npm install -g npm; fi && \
303304
sudo apt-get clean && \
304305
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; \
305306
fi;

Dockerfile.slim.fpm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \
323323
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
324324
sudo apt-get update && \
325325
sudo apt-get install -y --no-install-recommends yarn && \
326+
if [[ "${NODE_VERSION}" == "10" ]]; then npm install -g npm@^6.14; else npm install -g npm; fi && \
326327
sudo apt-get clean && \
327328
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; \
328329
fi;

tests-suite/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Test suite
2+
3+
These tests use bash_unit to allow a clean visualisation of tests.
4+
This file describe some features used here.
5+
6+
## `./config` file
7+
8+
This file allow the test suite to have some variables / command already set. You can customize.
9+
10+
## Setup/teardown
11+
12+
Like any regular test unit process, you can play command at initialisation of the test, and other at this end. It's used to generate fake directories or start docker commands. The teardown allow to clean directory/started container but if any fatal error happens (or `ctrl+c`), the tear down if not played. So you can have unwanted container started (you need to clean them manually, but it's not require to clean to re-execute because port/name/directory are random and uniq for each test suite).
13+
14+
## Pipe to `/dev/null`
15+
16+
Lot of command display result, error, warning. All are forward to /dev/null when it's not relevant (only the exit code is used `$?`). It's maybe usefull to provide a full log on these cases if it's possible to find a solution for that.
17+
18+
## Uncommon command `tail -n +1`
19+
20+
When there is comparaison with grep, it's required to prefix by ` | tail -n +1`. It's do nothing at all (only display from the first line to the end) but avoid this warning "write /dev/stdout: broken pipe" if command make too long time for response (required for arm64 testing).
21+
22+
## `[[ $VARIANT != apache* ]]`
23+
24+
Some part of the test is not depend on variant of image. Per example here, apache. It's maybe useful to find another way to just ignore the test instead of `exit 0` the full file (bash unit do not manage that currently).
25+

tests-suite/config

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,30 @@ export VARIANT=${VARIANT:-apache}
77
export BRANCH_VARIANT="${VARIANT//./-}"
88
export REPO="${REPO:-thecodingmachine/php}"
99
export TAG_PREFIX=""
10-
export SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
10+
export SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
11+
12+
function unused_port() {
13+
N=${1:-1}
14+
comm -23 \
15+
<(seq "1025" "65535" | sort) \
16+
<(ss -Htan |
17+
awk '{print $4}' |
18+
cut -d':' -f2 |
19+
sort -u) |
20+
shuf |
21+
head -n "$N"
22+
}
23+
24+
function waitfor() {
25+
URL=${1}
26+
TIMEOUT=${2:-60}
27+
while ! curl -sq "${URL}" > /dev/null 2>&1; do
28+
TIMEOUT=$((TIMEOUT-=1))
29+
if [[ "${TIMEOUT}" -lt "1" ]]; then
30+
>&2 echo "Can not fetch ${URL}"
31+
return 1
32+
fi
33+
sleep 1
34+
done
35+
return 0
36+
}

tests-suite/onbuild.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ test_onbluidBase() {
1313
assert 'onbluidBaseExtensionIsPresent pdo_sqlite' "Extension pdo_sqlite not found"
1414
}
1515
onbluidBase() {
16-
docker ${BUILDTOOL} -t test/slim_onbuild - <<EOF
16+
docker ${BUILDTOOL} -t ${DOCKER1_NAME} - <<EOF
1717
ARG PHP_EXTENSIONS="pdo_pgsql pdo_sqlite"
1818
FROM ${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}
1919
EOF
2020
return $?
2121
}
2222
onbluidBaseExtensionIsPresent() {
23-
docker run ${RUN_OPTIONS} --rm test/slim_onbuild php -m | grep -q ${1}
23+
docker run ${RUN_OPTIONS} --rm ${DOCKER1_NAME} php -m | grep -q ${1}
2424
return $?
2525
}
2626

@@ -48,16 +48,18 @@ EOF
4848
# Let's check that GD is available.
4949
RUN composer install
5050
EOF
51-
docker ${BUILDTOOL} -t test/slim_onbuild_composer "${TMP_DIR}"
51+
docker ${BUILDTOOL} -t ${DOCKER2_NAME} "${TMP_DIR}"
5252
return $?
5353
}
5454

5555
setup_suite() {
5656
export TMP_DIR="$(mktemp -d)"
57+
export DOCKER1_NAME="test/slim_onbuild_$(unused_port)"
58+
export DOCKER2_NAME="test/slim_onbuild_composer_$(unused_port)"
5759
}
5860

5961
teardown_suite() {
60-
docker rmi test/slim_onbuild > /dev/null
61-
docker rmi test/slim_onbuild_composer > /dev/null
62+
docker rmi --force "${DOCKER1_NAME}" > /dev/null
63+
docker rmi --force "${DOCKER2_NAME}" > /dev/null
6264
if [[ "" != ${TMP_DIR} ]]; then docker run ${RUN_OPTIONS} --rm -v "/tmp":/tmp busybox rm -rf "${TMP_DIR}" > /dev/null 2>&1; fi
6365
}

tests-suite/php-blackfire.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
test_enable() {
99
# Check that blackfire can be enabled
1010
docker run ${RUN_OPTIONS} --rm -e PHP_EXTENSION_BLACKFIRE=1 "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" \
11-
php -m | grep -q blackfire
11+
php -m | tail -n +1 | grep -q blackfire
1212
assert_equals "0" "$?"
1313
}
1414
test_alertConflictWithXDebug() {
1515
# Tests that blackfire + xdebug will output an error
1616
RESULT="$(docker run ${RUN_OPTIONS} --rm -e PHP_EXTENSION_XDEBUG=1 -e PHP_EXTENSION_BLACKFIRE=1 \
1717
"${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}" \
18-
php -v 2>&1 | grep 'WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire.')"
18+
php -v 2>&1 | tail -n +1 | grep 'WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire.')"
1919
assert_equals "WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire." "$RESULT"
2020
}
2121

tests-suite/php-extensions.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
# (it's compiled in PHP)
77
###########################################################
88
test_presenceOfMbstring() {
9-
docker run ${RUN_OPTIONS} --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" php -m | grep -q mbstring
10-
assert_equals "0" "$?" "Missing php-mbstring"
9+
RESULT=$(docker run ${RUN_OPTIONS} --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" php -m | tail -n +1 | grep --color=never mbstring)
10+
assert_equals "mbstring" "${RESULT}" "Missing php-mbstring"
1111
}
1212
############################################################
1313
## Let's check that mbstring is enabled by default
1414
## (it's compiled in PHP)
1515
############################################################
1616
test_presenceOfPDO() {
17-
docker run ${RUN_OPTIONS} --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" php -m | grep -q PDO
18-
assert_equals "0" "$?" "Missing php-PDO"
17+
RESULT=$(docker run ${RUN_OPTIONS} --rm "${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" php -m | tail -n +1 | grep --color=never PDO)
18+
assert_equals "PDO" "${RESULT}" "Missing php-PDO"
1919
}
2020
############################################################
2121
## Let's check that the extensions are enabled when composer is run

tests-suite/variant-apache.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,63 @@ fi;
99
## Run apache and try to retrieve var content
1010
############################################################
1111
test_displayVarInPhp() {
12-
RESULT="$(curl -sq http://localhost:81/apache/)"
12+
RESULT="$(curl -sq http://localhost:${DOCKER1_PORT}/apache/ 2>&1)"
1313
assert_equals "foo" "$RESULT" "MYVAR was not populate onto php"
1414
}
1515
############################################################
1616
## Run apache with relative document root
1717
############################################################
1818
test_documentRootRelative() {
19-
RESULT="$(curl -sq http://localhost:82/)"
19+
RESULT="$(curl -sq http://localhost:${DOCKER2_PORT}/ 2>&1)"
2020
assert_equals "foo" "$RESULT" "Apache document root (relative) does not work properly"
2121
}
2222
############################################################
2323
## Run apache with absolute document root
2424
############################################################
2525
test_documentRootAbsolute() {
26-
RESULT="$(curl -sq http://localhost:83/)"
26+
RESULT="$(curl -sq http://localhost:${DOCKER3_PORT}/ 2>&1)"
2727
assert_equals "foo" "$RESULT" "Apache document root (absolute) does not work properly"
2828
}
2929
############################################################
3030
## Run apache HtAccess
3131
############################################################
3232
test_htaccessRewrite() {
33-
RESULT="$(curl -sq http://localhost:81/apache/htaccess/)"
33+
RESULT="$(curl -sq http://localhost:${DOCKER1_PORT}/apache/htaccess/ 2>&1)"
3434
assert_equals "foo" "$RESULT" "Apache HtAccess RewriteRule was not applied"
3535
}
3636
############################################################
3737
## Test PHP_INI_... variables are correctly handled by apache
3838
############################################################
3939
test_changeMemoryLimit() {
40-
RESULT="$(curl -sq http://localhost:81/apache/echo_memory_limit.php)"
40+
RESULT="$(curl -sq http://localhost:${DOCKER1_PORT}/apache/echo_memory_limit.php 2>&1 )"
4141
assert_equals "2G" "$RESULT" "Apache PHP_INI_MEMORY_LIMIT was not applied"
4242
}
4343

4444
setup_suite() {
4545
# SETUP apache1
46-
docker run --name test-apache1 ${RUN_OPTIONS} --rm -e MYVAR=foo -e PHP_INI_MEMORY_LIMIT=2G -p "81:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/html \
46+
export DOCKER1_PORT="$(unused_port)"
47+
export DOCKER1_NAME="test-apache1-${DOCKER1_PORT}"
48+
docker run --name "${DOCKER1_NAME}" ${RUN_OPTIONS} --rm -e MYVAR=foo -e PHP_INI_MEMORY_LIMIT=2G -p "${DOCKER1_PORT}:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/html \
4749
"${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" > /dev/null
4850
assert_equals "0" "$?" "Docker run failed"
4951
# SETUP apache2
50-
docker run --name test-apache2 ${RUN_OPTIONS} --rm -e MYVAR=foo -e APACHE_DOCUMENT_ROOT=apache -p "82:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/html \
52+
export DOCKER2_PORT="$(unused_port)"
53+
export DOCKER2_NAME="test-apache2-${DOCKER2_PORT}"
54+
docker run --name "${DOCKER2_NAME}" ${RUN_OPTIONS} --rm -e MYVAR=foo -e APACHE_DOCUMENT_ROOT=apache -p "${DOCKER2_PORT}:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/html \
5155
"${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" > /dev/null
5256
assert_equals "0" "$?" "Docker run failed"
5357
# SETUP apache3
54-
docker run --name test-apache3 ${RUN_OPTIONS} --rm -e MYVAR=foo -e APACHE_DOCUMENT_ROOT=/var/www/foo/apache -p "83:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/foo \
58+
export DOCKER3_PORT="$(unused_port)"
59+
export DOCKER3_NAME="test-apache3-${DOCKER3_PORT}"
60+
docker run --name "${DOCKER3_NAME}" ${RUN_OPTIONS} --rm -e MYVAR=foo -e APACHE_DOCUMENT_ROOT=/var/www/foo/apache -p "${DOCKER3_PORT}:80" -d -v "${SCRIPT_DIR}/assets/":/var/www/foo \
5561
"${REPO}:${TAG_PREFIX}${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}" > /dev/null
5662
assert_equals "0" "$?" "Docker run failed"
57-
sleep 5 # Let's wait for Apache to start
63+
# Let's wait for Apache to start
64+
waitfor http://localhost:${DOCKER1_PORT}
65+
waitfor http://localhost:${DOCKER2_PORT}
66+
waitfor http://localhost:${DOCKER3_PORT}
5867
}
5968

6069
teardown_suite() {
61-
docker stop test-apache1 test-apache2 test-apache3 > /dev/null 2>&1
70+
docker stop "${DOCKER1_NAME}" "${DOCKER2_NAME}" "${DOCKER3_NAME}" > /dev/null 2>&1
6271
}

utils/Dockerfile.slim.blueprint

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ EXPOSE 80
210210

211211
ENV APACHE_DOCUMENT_ROOT=
212212

213-
RUN sed -ri -e "s!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf && \
214-
sed -ri -e "s!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
213+
RUN sed -ri -e 's!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
214+
sed -ri -e 's!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
215215

216216
# Let's remove the default Apache php.ini file (it will be copied from TEMPLATE_PHP_INI)
217217
RUN rm /etc/php/${PHP_VERSION}/apache2/php.ini
@@ -424,6 +424,7 @@ ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \
424424
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
425425
sudo apt-get update && \
426426
sudo apt-get install -y --no-install-recommends yarn && \
427+
if [[ "${NODE_VERSION}" == "10" ]]; then npm install -g npm@^6.14; else npm install -g npm; fi && \
427428
sudo apt-get clean && \
428429
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; \
429430
fi;

0 commit comments

Comments
 (0)