When initializing docker image circleci/postgres:9-alpine-postgis , I got an error and not work.
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/postgis.sh
/docker-entrypoint-initdb.d/postgis.sh: line 10: syntax error: bad substitution
LOG: received SIGHUP, reloading configuration files
LOG: parameter "listen_addresses" cannot be changed without restarting the server
LOG: configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors; unaffected changes were applied
Exited with code 2
Readers would need to see how you are creating this container. What do you have in your docker key in your YAML config? I wonder if you are using a command and it is causing a problem with the entrypoint.
Right, are you not running it in CircleCI using the docker key?
You can use docker run yourself, but I expect that you need to inject in some parameters, and the default entrypoint may well fall over if those params are not provided. Take a look on GitHub for the postgis.sh to see what it needs.
It may also just be worthwhile to see if there is some documentation on this image. I have not used it, but I imagine it might want a hostname/IP to listen on, and a default username/password of a root user?
waiting for server to start....LOG: database system was shut down at 2018-06-10 13:53:24 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
FATAL: role "root" does not exist
done
server started
CREATE DATABASE
CREATE ROLE
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/postgis.sh
/docker-entrypoint-initdb.d/postgis.sh: line 10: syntax error: bad substitution
LOG: received SIGHUP, reloading configuration files
LOG: parameter "listen_addresses" cannot be changed without restarting the server
LOG: configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors; unaffected changes were applied
waiting for server to start....LOG: database system was shut down at 2018-06-09 16:16:30 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
FATAL: role "root" does not exist
done
server started
CREATE DATABASE
CREATE ROLE
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/postgis.sh
CREATE DATABASE
UPDATE 1
Loading PostGIS extensions into template_postgis
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
Loading PostGIS extensions into thedatabase
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
waiting for server to shut down...LOG: received fast shutdown request
.LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2018-06-09 16:16:35 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
I wonder if there is a breaking change in postgis.sh? I expect this is on GitHub, so you could do a custom fix initially, running from your own Docker registry, and then if that works, raise a PR for CircleCI folks to merge in for the next version.
Something definitely broke between Friday and today. There was a new push of images sometime at the end of last week that introduced the problem. See also this issue reported on GitHub for the images repo.
I worked around the issue in the meantime by using 10.3-postgis-ram instead of 10-postgis-ram (which points to 10.4) - it seems the issue only exists in the “latest” for each major version
I also opened a ticket with CircleCI since these are their convenience images
The is an issue with the PostGIS variant images that was caused due to an upstream change with the PostgreSQL image. A possible fix has been merged and new images should be produced soon. I’ll follow up.