0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-25 12:50:54 +02:00

Remove build deps automatically

This commit is contained in:
Tilo Spannagel 2018-01-04 22:35:31 +01:00
parent ac4ac6366b
commit ec85464109
No known key found for this signature in database
GPG key ID: B89F1626A58E1429
6 changed files with 392 additions and 276 deletions

View file

@ -6,6 +6,11 @@ declare -A cmd=(
[fpm]='php-fpm'
)
declare -A extras=(
[apache]='\nRUN a2enmod rewrite'
[fpm]=''
)
# version_greater_or_equal A B returns whether A >= B
function version_greater_or_equal() {
[[ "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" || "$1" == "$2" ]];
@ -43,6 +48,7 @@ for latest in "${latests[@]}"; do
s/%%VARIANT%%/'"$variant"'/g;
s/%%VERSION%%/'"$latest"'/g;
s/%%CMD%%/'"${cmd[$variant]}"'/g;
s/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/g;
' "$version/$variant/Dockerfile"
# Copy the docker-entrypoint.
@ -51,9 +57,8 @@ for latest in "${latests[@]}"; do
# Copy the config directory
cp -rT .config "$version/$variant/config"
# Remove Apache commands and configs if we're not an Apache variant.
# Remove Apache config if we're not an Apache variant.
if [ "$variant" != "apache" ]; then
sed -ri -e '/a2enmod/d' "$version/$variant/Dockerfile"
rm "$version/$variant/config/apache-pretty-urls.config.php"
fi