Skip to content

Conversation

thresheek
Copy link
Contributor

This fixes nginx/docker-nginx#416 -
inability to start a container on a read-only filesystem.

This fixes nginx/docker-nginx#416 -
inability to start a container on a read-only filesystem.
@github-actions
Copy link

github-actions bot commented Jun 2, 2020

Diff for 56d878b:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 803fc22..e04d930 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -23,20 +23,20 @@ Directory: stable/buster-perl
 
 Tags: 1.19.0, mainline, 1, 1.19, latest
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 0b607f324d208664f37f7c1136ada6b249ddcd9b
+GitCommit: 2ef3fa66f2a434cd5e44e35a02f4ac502cf50808
 Directory: mainline/buster
 
 Tags: 1.19.0-alpine, mainline-alpine, 1-alpine, 1.19-alpine, alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 0b607f324d208664f37f7c1136ada6b249ddcd9b
+GitCommit: 2ef3fa66f2a434cd5e44e35a02f4ac502cf50808
 Directory: mainline/alpine
 
 Tags: 1.19.0-alpine-perl, mainline-alpine-perl, 1-alpine-perl, 1.19-alpine-perl, alpine-perl
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 0b607f324d208664f37f7c1136ada6b249ddcd9b
+GitCommit: 2ef3fa66f2a434cd5e44e35a02f4ac502cf50808
 Directory: mainline/alpine-perl
 
 Tags: 1.19.0-perl, mainline-perl, 1-perl, 1.19-perl, perl
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 0b607f324d208664f37f7c1136ada6b249ddcd9b
+GitCommit: 2ef3fa66f2a434cd5e44e35a02f4ac502cf50808
 Directory: mainline/buster-perl
diff --git a/nginx_alpine-perl/10-listen-on-ipv6-by-default.sh b/nginx_alpine-perl/10-listen-on-ipv6-by-default.sh
index 0ee4872..6885a9d 100755
--- a/nginx_alpine-perl/10-listen-on-ipv6-by-default.sh
+++ b/nginx_alpine-perl/10-listen-on-ipv6-by-default.sh
@@ -17,6 +17,9 @@ if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
     exit 0
 fi
 
+# check if the file can be modified, e.g. not on a r/o filesystem
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: Can not modify /$DEFAULT_CONF_FILE (read-only file system?), exiting"; exit 0; }
+
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo "$ME: IPv6 listen already enabled, exiting"; exit 0; }
 
diff --git a/nginx_alpine/10-listen-on-ipv6-by-default.sh b/nginx_alpine/10-listen-on-ipv6-by-default.sh
index 0ee4872..6885a9d 100755
--- a/nginx_alpine/10-listen-on-ipv6-by-default.sh
+++ b/nginx_alpine/10-listen-on-ipv6-by-default.sh
@@ -17,6 +17,9 @@ if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
     exit 0
 fi
 
+# check if the file can be modified, e.g. not on a r/o filesystem
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: Can not modify /$DEFAULT_CONF_FILE (read-only file system?), exiting"; exit 0; }
+
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo "$ME: IPv6 listen already enabled, exiting"; exit 0; }
 
diff --git a/nginx_latest/10-listen-on-ipv6-by-default.sh b/nginx_latest/10-listen-on-ipv6-by-default.sh
index 0ee4872..6885a9d 100755
--- a/nginx_latest/10-listen-on-ipv6-by-default.sh
+++ b/nginx_latest/10-listen-on-ipv6-by-default.sh
@@ -17,6 +17,9 @@ if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
     exit 0
 fi
 
+# check if the file can be modified, e.g. not on a r/o filesystem
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: Can not modify /$DEFAULT_CONF_FILE (read-only file system?), exiting"; exit 0; }
+
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo "$ME: IPv6 listen already enabled, exiting"; exit 0; }
 
diff --git a/nginx_perl/10-listen-on-ipv6-by-default.sh b/nginx_perl/10-listen-on-ipv6-by-default.sh
index 0ee4872..6885a9d 100755
--- a/nginx_perl/10-listen-on-ipv6-by-default.sh
+++ b/nginx_perl/10-listen-on-ipv6-by-default.sh
@@ -17,6 +17,9 @@ if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
     exit 0
 fi
 
+# check if the file can be modified, e.g. not on a r/o filesystem
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: Can not modify /$DEFAULT_CONF_FILE (read-only file system?), exiting"; exit 0; }
+
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo "$ME: IPv6 listen already enabled, exiting"; exit 0; }
 

@tianon tianon merged commit 2892633 into docker-library:master Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10-listen-on-ipv6-by-default.sh breaks read-only container

2 participants