1
0
mirror of https://github.com/docker-library/postgres.git synced 2025-11-17 13:02:40 +03:00

Add "mkdir ~postgres" with proper permissions

This commit is contained in:
Tianon Gravi
2017-04-25 14:59:57 -07:00
parent 3b9d57d935
commit ee20f10a40
6 changed files with 60 additions and 12 deletions

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down

View File

@@ -2,8 +2,16 @@
FROM alpine:3.5 FROM alpine:3.5
# alpine includes "postgres" user/group in base install # alpine includes "postgres" user/group in base install
# /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh # /etc/passwd:22:postgres:x:70:70::/var/lib/postgresql:/bin/sh
# /etc/group:34:postgres:x:70: # /etc/group:34:postgres:x:70:
# the home directory for the postgres user, however, is not created by default
# see https://github.com/docker-library/postgres/issues/274
RUN set -ex; \
postgresHome="$(getent passwd postgres)"; \
postgresHome="$(echo "$postgresHome" | cut -d: -f6)"; \
[ "$postgresHome" = '/var/lib/postgresql' ]; \
mkdir -p "$postgresHome"; \
chown -R postgres:postgres "$postgresHome"
# su-exec (gosu-compatible) is installed further down # su-exec (gosu-compatible) is installed further down