Skip to content

Exclude existing "pluggable" content in case it's been updated #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.2/apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.2/fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.2/fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.3/apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.3/fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.3/fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.4/apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.4/fpm-alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down
11 changes: 11 additions & 0 deletions php7.4/fpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
# avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
targetTarArgs+=( --no-overwrite-dir )
fi
# loop over "pluggable" content in the source, and if it already exists in the destination, skip it
# https://github.com/docker-library/wordpress/issues/506 ("wp-content" persisted, "akismet" updated, WordPress container restarted/recreated, "akismet" downgraded)
for contentDir in /usr/src/wordpress/wp-content/*/*/; do
contentDir="${contentDir%/}"
[ -d "$contentDir" ] || continue
contentPath="${contentDir#/usr/src/wordpress/}" # "wp-content/plugins/akismet", etc.
if [ -d "$PWD/$contentPath" ]; then
echo >&2 "WARNING: '$PWD/$contentPath' exists! (not copying the WordPress version)"
sourceTarArgs+=( --exclude "./$contentPath" )
fi
done
tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}"
echo >&2 "Complete! WordPress has been successfully copied to $PWD"
if [ ! -e .htaccess ]; then
Expand Down