/dockerpg8422

Primary LanguageDockerfile

Criação de um servidor PostgreSQL 8.4.22 dockado

Instalar o PostgreSQL 8.4.22 a partir do código fonte

apt install wget gcc zlib1g-dev libreadline6-dev docbook-dsssl docbook libreadline-dev libperl-dev libedit-dev libpam0g-dev libpam-dev libkrb5-dev libldap2-dev libxslt1-dev libossp-uuid-dev bison flex opensp tcl-dev xsltproc linux-headers-amd64 linux-headers-$(uname -r) -y

wget --continue https://ftp.postgresql.org/pub/source/v8.4.22/postgresql-8.4.22.tar.gz
tar -xzf postgresql-8.4.22.tar.gz

cd postgresql-8.4.22/
./configure --prefix=/home/user/usr/postgresql96
make
make install

Criar o diretório de dados e inicializa-lo

mkdir -p /home/user/data
cd /home/user/usr/postgresql96/bin
./initdb -D ~/data/ -U postgres

Alterar o password padrão do PostgreSQL

No SO do host

docker run -v /home/user/data/:/var/lib/postgresql/data/ --rm -it --entrypoint bash postgres96

No SO do container

pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/pglog.log start
psql

No psql

\password

\quit