Content-Length: 491170 | pFad | http://github.com/walter-trueplus/postgres/commit/ee20f10a40f8893d5f67d593ddd44ba05d0c9df9

72 Add "mkdir ~postgres" with proper permissions · walter-trueplus/postgres@ee20f10 · GitHub
Skip to content

Commit ee20f10

Browse files
committed
Add "mkdir ~postgres" with proper permissions
1 parent 3b9d57d commit ee20f10

File tree

6 files changed

+60
-12
lines changed

6 files changed

+60
-12
lines changed

9.2/alpine/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

9.3/alpine/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

9.4/alpine/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

9.5/alpine/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

9.6/alpine/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

Dockerfile-alpine.template

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
FROM alpine:3.5
33

44
# alpine includes "postgres" user/group in base install
5-
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6-
# /etc/group:34:postgres:x:70:
5+
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
6+
# /etc/group:34:postgres:x:70:
7+
# the home directory for the postgres user, however, is not created by default
8+
# see https://github.com/docker-library/postgres/issues/274
9+
RUN set -ex; \
10+
postgresHome="$(getent passwd postgres)"; \
11+
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
12+
[ "$postgresHome" = '/var/lib/postgresql' ]; \
13+
mkdir -p "$postgresHome"; \
14+
chown -R postgres:postgres "$postgresHome"
715

816
# su-exec (gosu-compatible) is installed further down
917

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/walter-trueplus/postgres/commit/ee20f10a40f8893d5f67d593ddd44ba05d0c9df9

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy