-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error command not found in initdb-postgis.sh #360
Comments
I have the same issue but cannot see how this is not a dupe of #358 In my case, I copied the Dockerfile (and .sh scripts) contents and recreated the files myself. (I'm doing this to fiddle with the Dockerfile, to troubleshoot another issue). I am using 15-3.4 alpine, but the initdb script is exactly the same. The image builds fine. Attempting to run the image yeilds results exactly like OPs -- line 16 of the initdb is failing and the error suggests # Create the 'template_postgis' template db
"${psql[@]}" <<- 'EOSQL'
CREATE DATABASE template_postgis IS_TEMPLATE true;
EOSQL
# Load PostGIS into both template_database and $POSTGRES_DB
for DB in template_postgis "$POSTGRES_DB"; do
echo "Loading PostGIS extensions into $DB"
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
CREATE EXTENSION IF NOT EXISTS postgis;
This is especially baffling because Sorry to say I'm completely woeful with pretty much every tech at play here, and doubt i will be able to help further |
Answer will be in here |
Can be worked around by adding below block near the start of the script docker_process_sql() {
local query_runner=( psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --no-password --no-psqlrc )
if [ -n "$POSTGRES_DB" ]; then
query_runner+=( --dbname "$POSTGRES_DB" )
fi
PGHOST= PGHOSTADDR= "${query_runner[@]}" "$@"
}
psql=( docker_process_sql ) This seems to be because the script is using Workaround: copy the |
If the image downloaded with And this is also the recommended way in the parent docker-library/postgis repo
The file system is also crucial. Unfortunately, if you're not using Linux as your operating system, I can't be of much help since I use Ubuntu Linux. And the building of the images also takes place in the cloud under Linux. |
For me it's condition resolved
Anyway because it happens? Anyone have the answer? I think and it seems to me variable "${psql[@]}" should exists in another place... |
Update
Update here... https://stackoverflow.com/questions/57665146/what-is-the-meaning-of-psql-in-this-script |
@daweimau Thanks fo the workaround 👌 works perfectly fine. Haven't found a fix yet though. |
发现有类似的Issues问题 #358
我使用的版本是12-3.4 此问题出现在自行构建docker-image的时候, 而通过docker pull拉取的是没有问题的
经过排查 发现initdb-postgis.sh存在问题
如下所示${psql[@]}存在为空的情况, 我不知道这个值是什么时候写入的,固增加前置判断处理
烦请作者给出答复是否存在这样的问题,以及这样处理是否合适,感谢
The text was updated successfully, but these errors were encountered: