Skip to content

Commit a51c16e

Browse files
committed
Add a pid cleaner in case container was killed unexpectedly
1 parent 61918f0 commit a51c16e

File tree

10 files changed

+29
-92
lines changed

10 files changed

+29
-92
lines changed

5.4/apache/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ RUN buildDeps=" \
6767
COPY docker-php-ext-* /usr/local/bin/
6868

6969
##<autogenerated>##
70+
COPY apache2-foreground /usr/local/bin/
7071
WORKDIR /var/www/html
7172

7273
EXPOSE 80
73-
CMD ["apache2", "-DFOREGROUND"]
74+
CMD ["apache2-foreground"]
7475
##</autogenerated>##

5.4/apache/apache2-foreground

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Apache gets grumpy about PID files pre-existing
5+
rm -f /var/run/apache2/apache2.pid
6+
7+
exec apache2 -DFOREGROUND

5.5/apache/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ RUN buildDeps=" \
6767
COPY docker-php-ext-* /usr/local/bin/
6868

6969
##<autogenerated>##
70+
COPY apache2-foreground /usr/local/bin/
7071
WORKDIR /var/www/html
7172

7273
EXPOSE 80
73-
CMD ["apache2", "-DFOREGROUND"]
74+
CMD ["apache2-foreground"]
7475
##</autogenerated>##

5.5/apache/apache2-foreground

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Apache gets grumpy about PID files pre-existing
5+
rm -f /var/run/apache2/apache2.pid
6+
7+
exec apache2 -DFOREGROUND

5.6/apache/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ RUN buildDeps=" \
6767
COPY docker-php-ext-* /usr/local/bin/
6868

6969
##<autogenerated>##
70+
COPY apache2-foreground /usr/local/bin/
7071
WORKDIR /var/www/html
7172

7273
EXPOSE 80
73-
CMD ["apache2", "-DFOREGROUND"]
74+
CMD ["apache2-foreground"]
7475
##</autogenerated>##

5.6/apache/apache2-foreground

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Apache gets grumpy about PID files pre-existing
5+
rm -f /var/run/apache2/apache2.pid
6+
7+
exec apache2 -DFOREGROUND

apache-Dockerfile-block-2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
COPY apache2-foreground /usr/local/bin/
12
WORKDIR /var/www/html
23

34
EXPOSE 80
4-
CMD ["apache2", "-DFOREGROUND"]
5+
CMD ["apache2-foreground"]

apache2.conf

Lines changed: 0 additions & 62 deletions
This file was deleted.

php-fpm.conf

Lines changed: 0 additions & 23 deletions
This file was deleted.

update.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ for version in "${versions[@]}"; do
5151
s/^(ENV PHP_VERSION) .*/\1 '"$fullVersion"'/;
5252
s/^(RUN gpg .* --recv-keys) [0-9a-fA-F ]*$/\1 '"$gpgKey"'/
5353
' "$version/Dockerfile" "$version/"*/Dockerfile
54-
55-
cp apache2.conf "$version/apache/"
56-
cp php-fpm.conf "$version/fpm/"
5754
)
5855
done
5956

0 commit comments

Comments
 (0)