Skip to content
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

Update postgres #7569

Merged
merged 1 commit into from
Mar 4, 2020
Merged

Conversation

tianon
Copy link
Member

@tianon tianon commented Mar 4, 2020

Changes:

Changes:

- docker-library/postgres@04f2884: Merge pull request docker-library/postgres#694 from infosiftr/ls
- docker-library/postgres@33bccfc: Fix silently skipped init scripts
@tianon
Copy link
Member Author

tianon commented Mar 4, 2020

Diff:
diff --git a/postgres_10-alpine/docker-entrypoint.sh b/postgres_10-alpine/docker-entrypoint.sh
index 78adac6..e761e26 100755
--- a/postgres_10-alpine/docker-entrypoint.sh
+++ b/postgres_10-alpine/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_10/docker-entrypoint.sh b/postgres_10/docker-entrypoint.sh
index a9190b4..cd8ce80 100755
--- a/postgres_10/docker-entrypoint.sh
+++ b/postgres_10/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_11-alpine/docker-entrypoint.sh b/postgres_11-alpine/docker-entrypoint.sh
index 78adac6..e761e26 100755
--- a/postgres_11-alpine/docker-entrypoint.sh
+++ b/postgres_11-alpine/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_11/docker-entrypoint.sh b/postgres_11/docker-entrypoint.sh
index a9190b4..cd8ce80 100755
--- a/postgres_11/docker-entrypoint.sh
+++ b/postgres_11/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_9-alpine/docker-entrypoint.sh b/postgres_9-alpine/docker-entrypoint.sh
index f87b08b..aad5d4d 100755
--- a/postgres_9-alpine/docker-entrypoint.sh
+++ b/postgres_9-alpine/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_9.5-alpine/docker-entrypoint.sh b/postgres_9.5-alpine/docker-entrypoint.sh
index f87b08b..aad5d4d 100755
--- a/postgres_9.5-alpine/docker-entrypoint.sh
+++ b/postgres_9.5-alpine/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_9.5/docker-entrypoint.sh b/postgres_9.5/docker-entrypoint.sh
index 84eb98d..1ba1cfc 100755
--- a/postgres_9.5/docker-entrypoint.sh
+++ b/postgres_9.5/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_9/docker-entrypoint.sh b/postgres_9/docker-entrypoint.sh
index 84eb98d..1ba1cfc 100755
--- a/postgres_9/docker-entrypoint.sh
+++ b/postgres_9/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_alpine/docker-entrypoint.sh b/postgres_alpine/docker-entrypoint.sh
index 78adac6..e761e26 100755
--- a/postgres_alpine/docker-entrypoint.sh
+++ b/postgres_alpine/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 
diff --git a/postgres_latest/docker-entrypoint.sh b/postgres_latest/docker-entrypoint.sh
index a9190b4..cd8ce80 100755
--- a/postgres_latest/docker-entrypoint.sh
+++ b/postgres_latest/docker-entrypoint.sh
@@ -284,6 +284,10 @@ _main() {
 		# only run initialization on an empty data directory
 		if [ -z "$DATABASE_ALREADY_EXISTS" ]; then
 			docker_verify_minimum_env
+
+			# check dir permissions to reduce likelihood of half-initialized database
+			ls /docker-entrypoint-initdb.d/ > /dev/null
+
 			docker_init_database_dir
 			pg_setup_hba_conf
 

@tianon
Copy link
Member Author

tianon commented Mar 4, 2020

Build test of #7569; 6447ec5; amd64 (postgres):

$ bashbrew build postgres:12.2
Building bashbrew/cache:ead126e8aacc6b8f37a44c5709053ede6f0fb2cb7ceacbc6d891c163652b74e4 (postgres:12.2)
Tagging postgres:12.2
Tagging postgres:12
Tagging postgres:latest

$ test/run.sh postgres:12.2
testing postgres:12.2
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:12.2-alpine
Building bashbrew/cache:e87b5c4453865e18ae07def9b2549f12a28bc5ed4af99a8dbadcc628e5511cd4 (postgres:12.2-alpine)
Tagging postgres:12.2-alpine
Tagging postgres:12-alpine
Tagging postgres:alpine

$ test/run.sh postgres:12.2-alpine
testing postgres:12.2-alpine
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:11.7
Building bashbrew/cache:33720ef39c3de5ca348d0fa39c3f65e7c6651105676de3a15b0242a4fa743fd8 (postgres:11.7)
Tagging postgres:11.7
Tagging postgres:11

$ test/run.sh postgres:11.7
testing postgres:11.7
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:11.7-alpine
Building bashbrew/cache:448c2ac56e36ad20a0a7e27638fa9c1d22ea0c6848f7556af4de7043560e98e4 (postgres:11.7-alpine)
Tagging postgres:11.7-alpine
Tagging postgres:11-alpine

$ test/run.sh postgres:11.7-alpine
testing postgres:11.7-alpine
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:10.12
Building bashbrew/cache:a4987179c0c865ebd029f0f0b08c8f0d5c53b4cc97a80b49d0af0bf6bc7e72da (postgres:10.12)
Tagging postgres:10.12
Tagging postgres:10

$ test/run.sh postgres:10.12
testing postgres:10.12
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:10.12-alpine
Building bashbrew/cache:f010a40bf331572b96dac8d46b92388b96b8289708b56216e7d7f04d6af8d35a (postgres:10.12-alpine)
Tagging postgres:10.12-alpine
Tagging postgres:10-alpine

$ test/run.sh postgres:10.12-alpine
testing postgres:10.12-alpine
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:9.6.17
Building bashbrew/cache:2dd2ccd5db7e56ec08dc82ab738183d9159f3bb02ecb83e4397dfa35e76bd882 (postgres:9.6.17)
Tagging postgres:9.6.17
Tagging postgres:9.6
Tagging postgres:9

$ test/run.sh postgres:9.6.17
testing postgres:9.6.17
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed


$ bashbrew build postgres:9.6.17-alpine
Building bashbrew/cache:6f4609a28f33eb5eaa8c1c3c3e1607b39730093341815cd3d180f05086cf1103 (postgres:9.6.17-alpine)
Tagging postgres:9.6.17-alpine
Tagging postgres:9.6-alpine
Tagging postgres:9-alpine

$ test/run.sh postgres:9.6.17-alpine
testing postgres:9.6.17-alpine
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6].....passed
	'postgres-initdb' [6/6].....passed


$ bashbrew build postgres:9.5.21
Building bashbrew/cache:0bcb64f1e1afa56b23d2a072dc472bbef2496ba96d475cb54e6642bd1c77a289 (postgres:9.5.21)
Tagging postgres:9.5.21
Tagging postgres:9.5

$ test/run.sh postgres:9.5.21
testing postgres:9.5.21
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6].....passed
	'postgres-initdb' [6/6]......passed


$ bashbrew build postgres:9.5.21-alpine
Building bashbrew/cache:dd9b8db2fec6edcb65fdc3be671f8bc8b9218b9ddb53a404292b32d9df7e0610 (postgres:9.5.21-alpine)
Tagging postgres:9.5.21-alpine
Tagging postgres:9.5-alpine

$ test/run.sh postgres:9.5.21-alpine
testing postgres:9.5.21-alpine
	'utc' [1/6]...passed
	'cve-2014--shellshock' [2/6]...passed
	'no-hard-coded-passwords' [3/6]...passed
	'override-cmd' [4/6]...passed
	'postgres-basics' [5/6]....passed
	'postgres-initdb' [6/6]....passed

@tianon tianon merged commit e66c6d7 into docker-library:master Mar 4, 2020
@tianon tianon deleted the postgres branch March 4, 2020 16:26
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.

2 participants