Skip to content

Commit d21c27b

Browse files
revertendo para imagem base
1 parent 0dd9019 commit d21c27b

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ RUN set -eux; \
5858

5959
RUN mkdir /docker-entrypoint-initdb.d
6060

61-
6261
RUN set -ex; \
6362
# pub 4096R/ACCC4CF8 2011-10-13 [expires: 2019-07-02]
6463
# Key fingerprint = B97B 0AFC AA1A 47F0 44F2 44A0 7FCC 7D46 ACCC 4CF8
@@ -161,14 +160,13 @@ RUN set -eux; \
161160
ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/"; \
162161
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample; \
163162
grep -F "listen_addresses = '*'" /usr/share/postgresql/postgresql.conf.sample
164-
163+
165164
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod 2777 /var/run/postgresql
166165

167166
ENV PATH $PATH:/usr/lib/postgresql/$PG_MAJOR/bin
168167
ENV PGDATA /var/lib/postgresql/data
169168
# this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values)
170169
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA"
171-
#RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA"
172170
VOLUME /var/lib/postgresql/data
173171

174172
COPY docker-entrypoint.sh /usr/local/bin/

docker-entrypoint.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fi
3232
if [ "$1" = 'postgres' ] && [ "$(id -u)" = '0' ]; then
3333
mkdir -p "$PGDATA"
3434
chown -R postgres "$PGDATA"
35-
chmod 777 "$PGDATA"
35+
chmod 700 "$PGDATA"
3636

3737
mkdir -p /var/run/postgresql
3838
chown -R postgres /var/run/postgresql
@@ -51,7 +51,7 @@ fi
5151
if [ "$1" = 'postgres' ]; then
5252
mkdir -p "$PGDATA"
5353
chown -R "$(id -u)" "$PGDATA" 2>/dev/null || :
54-
chmod 777 "$PGDATA" 2>/dev/null || :
54+
chmod 700 "$PGDATA" 2>/dev/null || :
5555

5656
# look specifically for PG_VERSION, as it is expected in the DB dir
5757
if [ ! -s "$PGDATA/PG_VERSION" ]; then
@@ -87,14 +87,10 @@ if [ "$1" = 'postgres' ]; then
8787

8888
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
8989
cat >&2 <<-'EOWARN'
90-
9190
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92-
9391
This will not work if used via PGPASSWORD with "psql".
94-
9592
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
9693
https://github.com/docker-library/postgres/issues/507
97-
9894
EOWARN
9995
fi
10096
else
@@ -107,7 +103,6 @@ if [ "$1" = 'postgres' ]; then
107103
Docker's default configuration, this is
108104
effectively any other container on the same
109105
system.
110-
111106
Use "-e POSTGRES_PASSWORD=password" to set
112107
it in "docker run".
113108
****************************************************
@@ -172,5 +167,5 @@ if [ "$1" = 'postgres' ]; then
172167
echo
173168
fi
174169
fi
175-
#chmod 777 "$PGDATA" 2>/dev/null
170+
176171
exec "$@"

0 commit comments

Comments
 (0)