I hope this is enough and I'm not just doing something stupid. Thank you!
Dockerfile
docker-compose.yml
version: '3.3'
services:
postgres:
image: "postgres:12.4"
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=icd
volumes:
postgres:
driver: local
pre-install for docker:
sudo docker ps
export CONTAINER=<containername from above>
e.g. export CONTAINER=docker_postgres_1
sudo docker exec -it $CONTAINER /bin/sh -c "mkdir /home/pgtap"
sudo docker cp pgtap-*.zip $CONTAINER:/home/pgtap
sudo docker exec -it $CONTAINER /bin/sh
install:
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y dist-upgrade && \
apt-get -y autoremove && \
apt-get -y clean && \
apt-get -y install zip && \
apt-get -y install make && \
apt-get -y install patch && \
apt-get -y install vim
cd /home/pgtap
unzip pgtap-1.1.0.zip
cd pgtap-1.1.0
make
make install
cpan TAP::Parser::SourceHandler::pgTAP
would you like ... automatically? yes
should end in /usr/bin/make install -- OK
make installcheck PGUSER=postgres PGHOST=0.0.0.0 PGPORT=5432
!! breaks here, ...
make: *** No rule to make target 'installcheck'. Stop.
cd sql
psql -h0.0.0.0 -p5432 -d icd -U postgres -f pgtap.sql > pgtap.log 2>&1
!! breaks here, ...
< see below, shows some of output >
grep ERROR pgtap.log
should not return any
# ls -l /usr/lib/postgresql/12/lib/plpgsql.so
-rwxrwxrwx 1 root root 198736 Sep 29 08:43 /usr/lib/postgresql/12/lib/plpgsql.so
# psql -h0.0.0.0 -p5432 -d icd -U postgres -f pgtap.sql
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
psql:pgtap.sql:61: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:69: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:79: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:93: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:104: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:114: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:124: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:140: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:145: ERROR: function _set(text, integer, unknown) does not exist
LINE 3: SELECT _set($1, $2, '')
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:pgtap.sql:154: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:163: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:168: ERROR: function _add(text, integer, unknown) does not exist
LINE 3: SELECT _add($1, $2, '')
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:pgtap.sql:176: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:181: ERROR: function _get(unknown) does not exist
LINE 3: SELECT _get('failed');
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
psql:pgtap.sql:223: ERROR: could not load library "/usr/lib/postgresql/12/lib/plpgsql.so": /usr/lib/postgresql/12/lib/plpgsql.so: undefined symbol: EnsurePortalSnapshotExists
psql:pgtap.sql:233: ERROR: function _get(unknown) does not exist
LINE 4: _get('curr_test'),
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
... continutes (very long, same exact error)