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