Puncte:0

Howto build docker postgres image with pgcrypto sha3-512 support?

drapel cn

I need to create a postgresql 11 docker image that has support for sha3-512 hash function. By default, the official postgres docker images do not support this. I already have some systems that use the official docker images. I need a new image that works exactly like the official, except that it has support for these hash functions. My idea was to create a copy of the official Dockerfile and modify it.

According to the configuration notes section here: https://www.postgresql.org/docs/11/pgcrypto.html#id-1.11.7.34.10 the SHA224/256/384/512 hash functions are supported only if postgresql was configured and built with --with-openssl

I have copied the Dockerfile and the entrypoint script from here:

https://github.com/docker-library/postgres/tree/master/11/stretch

and then, I'm stuck. I have no idea how or where to add "--with-openssl". I suspect that the configuration and compilation happens at this section:

# build .deb files from upstream's source packages (which are verified by apt-get)
            apt-get update; \
            apt-get build-dep -y \
                postgresql-common pgdg-keyring \
                "postgresql-$PG_MAJOR=$PG_VERSION" \
            ; \
            DEB_BUILD_OPTIONS="nocheck parallel=$(nproc)" \
                apt-get source --compile \
                    postgresql-common pgdg-keyring \
                    "postgresql-$PG_MAJOR=$PG_VERSION" \
            ; \

but at this point, I don't know what to do, or what to change.

The error itself is like this

select digest('test','sha3-512')
SQL Error [22023]: ERROR: Cannot use "sha3-512": No such hash algorithm

Seemingly, there are no additional hash algorithms added:

postgres=# \df digest
                       List of functions
 Schema | Name | Result data type | Argument data types | Type 
--------+------+------------------+---------------------+------
(0 rows)

postgres=# select * from pg_available_extensions where name='pgcrypto';
name    |default_version|installed_version|comment                |
--------+---------------+-----------------+-----------------------+
pgcrypto|1.3            |1.3              |cryptographic functions|
drapel cn
Dacă pornesc imaginea oficială și execut „pg_config” în ea, atunci „--with-openssl” este prezent în CONFIGURE, dar algoritmul sha3-512 nu este disponibil oricum. Deci, poate că problema nu este opțiunea --with-openssl lipsă. Dar atunci ce?
Puncte:0
drapel cn

După ce am încercat diferite soluții posibile (cu puțin ajutor), am aflat că postgres:11.14-bullseye funcționează corect și conține toate funcțiile hash openssl. Interesant, implicit postgres:11 le lipsesc.

Postează un răspuns

Majoritatea oamenilor nu înțeleg că a pune multe întrebări deblochează învățarea și îmbunătățește legătura interpersonală. În studiile lui Alison, de exemplu, deși oamenii își puteau aminti cu exactitate câte întrebări au fost puse în conversațiile lor, ei nu au intuit legătura dintre întrebări și apreciere. În patru studii, în care participanții au fost implicați în conversații ei înșiși sau au citit transcrieri ale conversațiilor altora, oamenii au avut tendința să nu realizeze că întrebarea ar influența – sau ar fi influențat – nivelul de prietenie dintre conversatori.