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:
parent
ac4ac6366b
commit
ec85464109
6 changed files with 392 additions and 276 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue