fix start ssh
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,7 +1,5 @@
|
||||
FROM postgres:15
|
||||
|
||||
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
postgresql-$PG_MAJOR-repmgr \
|
||||
@@ -14,11 +12,17 @@ VOLUME /etc/repmgr
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
openssh-server \
|
||||
&& \
|
||||
sudo \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
echo "postgres ALL = (ALL) NOPASSWD:ALL" >> /etc/sudoers && \
|
||||
echo "X11Forwarding no" >> /etc/ssh/sshd_config && \
|
||||
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
|
||||
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
|
||||
mkdir -p /var/lib/postgresql/.ssh && \
|
||||
chmod 700 /var/lib/postgresql/.ssh && \
|
||||
chown postgres: /var/lib/postgresql/.ssh
|
||||
chown postgres: /var/lib/postgresql/.ssh && \
|
||||
chmod g-w,o-w /var/lib/postgresql
|
||||
|
||||
COPY --chmod=644 --chown=postgres profile /var/lib/postgresql/.profile
|
||||
COPY --chmod=600 --chown=postgres authorized_keys id_ed25519 /var/lib/postgresql/.ssh/
|
||||
|
||||
@@ -184,7 +184,7 @@ if [[ ! -s "$PGDATA/PG_VERSION" ]]; then
|
||||
docker_temp_server_stop
|
||||
fi
|
||||
|
||||
service ssh start
|
||||
sudo service ssh start
|
||||
|
||||
set -m
|
||||
|
||||
|
||||
Reference in New Issue
Block a user