mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-06-28 08:06:42 +08:00
do not start ssh deamon, use nsenter for shell access to the container
This commit is contained in:
@@ -9,8 +9,6 @@ ADD assets/ /app/
|
||||
RUN chmod 755 /app/init /app/setup/install
|
||||
RUN /app/setup/install
|
||||
|
||||
ADD authorized_keys /root/.ssh/
|
||||
|
||||
EXPOSE 5432
|
||||
|
||||
VOLUME ["/var/lib/postgresql"]
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
- [Configuration](#configuration)
|
||||
- [Data Store](#data-store)
|
||||
- [Securing the server](#securing-the-server)
|
||||
- [Maintenance](#maintenance)
|
||||
- [SSH Login](#ssh-login)
|
||||
- [Issues](#issues)
|
||||
|
||||
# Introduction
|
||||
@@ -89,18 +87,6 @@ psql -U postgres -h ${POSTGRESQL_IP}
|
||||
\password postgres
|
||||
```
|
||||
|
||||
# Maintenance
|
||||
|
||||
## SSH Login
|
||||
There are two methods to gain root login to the container, the first method is to add your public rsa key to the authorized_keys file and build the image.
|
||||
|
||||
The second method is use the dynamically generated password. Every time the container is started a random password is generated using the pwgen tool and assigned to the root user. This password can be fetched from the docker logs.
|
||||
|
||||
```bash
|
||||
docker logs postgresql 2>&1 | grep '^User: ' | tail -n1
|
||||
```
|
||||
This password is not persistent and changes every time the image is executed.
|
||||
|
||||
# Upgrading
|
||||
|
||||
To upgrade to newer releases, simply follow this 3 step upgrade procedure.
|
||||
|
||||
@@ -9,7 +9,6 @@ echo User: root Password: $ROOT_PASSWORD
|
||||
|
||||
# start supervisord
|
||||
/usr/bin/supervisord
|
||||
supervisorctl start sshd
|
||||
|
||||
appStart () {
|
||||
# fix permissions and ownership of /var/lib/postgresql
|
||||
|
||||
Reference in New Issue
Block a user