Closed luisg123v closed 6 years ago
You should use /etc/init.d/postgresql start
instead.
Using
docker run -e PSQL_VERSION=9.6 -it --rm vauxoo/odoo-80-image-shippable-auto /etc/init.d/postgresql start
Starting PostgreSQL 9.6 database server
docker run -e PSQL_VERSION=9.5 -it --rm vauxoo/odoo-80-image-shippable-auto /etc/init.d/postgresql start
Starting PostgreSQL 9.5 database server
I'm using the latest build of the image:
docker pull vauxoo/odoo-80-image-shippable-auto
Using default tag: latest
latest: Pulling from vauxoo/odoo-80-image-shippable-auto
Digest: sha256:01379c9a31a08a47cefd5cab114fc776c7b558b034a7cb6f6ce03835504f8698
Status: Image is up to date for vauxoo/odoo-80-image-shippable-auto:latest
@moylop260 I don't like such a workaround. Init scripts are not intended to be called directly anymore.
The ideal solution would be to write all variables in /etc/environment
or so, and source that file from the custom script function. For more info, see This StackExchange answer.
Another solution could be to remove the ''
from here and, instead of using an harcoded 9.3
, take the value set for $PSQL_VERSION
at that point.
But well, if it's not possible, I could deal with that.
We are using the same WA from travis. Remeber that our image is a copy of travis one with good and bad practices like as virtualenv and init.d/postgresql script modified
:+1: I understand, thanks for the explanation.
I don't know if this worked, but it seems to not work anymore:
Debugging a little, I noticed the value of the variable
$PSQL_VERSION
is not retrievable in the init scripts, neither in/etc/init.d/postgresql
, nor/usr/share/postgresql-common/init.d-functions
.If I try to print the variable inside those scripts, nothing is printed, like if it was undefined.