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

Merge pull request #277 from infosiftr/alpine-mkdir-home

Add "mkdir ~postgres" with proper permissions
This commit is contained in:
yosifkit
2017-04-25 15:14:07 -07:00
committed by GitHub
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