File tree Expand file tree Collapse file tree 13 files changed +195
-65
lines changed Expand file tree Collapse file tree 13 files changed +195
-65
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
45
45
if [ -n " $( ls -A) " ]; then
46
46
echo >&2 " WARNING: $PWD is not empty! (copying anyhow)"
47
47
fi
48
- tar --create \
49
- --file - \
50
- --directory /usr/src/wordpress \
51
- --owner " $user " --group " $group " \
52
- . | tar --extract --file -
48
+ sourceTarArgs=(
49
+ --create
50
+ --file -
51
+ --directory /usr/src/wordpress
52
+ --owner " $user " --group " $group "
53
+ )
54
+ targetTarArgs=(
55
+ --extract
56
+ --file -
57
+ )
58
+ if [ " $user " != ' 0' ]; then
59
+ # avoid "tar: .: Cannot utime: Operation not permitted" and "tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted"
60
+ targetTarArgs+=( --no-overwrite-dir )
61
+ fi
62
+ tar " ${sourceTarArgs[@]} " . | tar " ${targetTarArgs[@]} "
53
63
echo >&2 " Complete! WordPress has been successfully copied to $PWD "
54
64
if [ ! -e .htaccess ]; then
55
65
# NOTE: The "Indexes" option is disabled in the php:apache base image
You can’t perform that action at this time.
0 commit comments