Build docker image from source but run failed with error :init_by_lua error: missing database for connect #375

I’m using latest go-pdk to develop go plugins, but official lastest version 2.0.4-centos missing some corresponding features.So I have to build costum image from latest source code as follow steps:
1.cd ~
2.git clone https://github.com/Kong/kong.git
3.git clone https://github.com/kong/kong-build-tools.git
4.cd kong-build-tools
5.RESTY_IMAGE_BASE=centos RESTY_IMAGE_TAG=7 PACKAGE_TYPE=rpm make package-kong
6.clone docker-kong
6.cp output/kong-2.0.4.el7.amd64.rpm docker-kong/centos/empty-kong.rpm
7.build centos image with built rpm package

RUN # set -ex;
# if [ "$ASSET" = "ce" ] ; then
# curl -fL "https://bintray.com/kong/kong-rpm/download_file?file_path=centos/7/kong-$KONG_VERSION.el7.amd64.rpm" -o /tmp/kong.rpm
# && echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -;
# fi;
yum install -y -q unzip shadow-utils git zlib zlib-devel ......

But when I run built images , it failed with followed errors(pg config already setted):
020/06/17 06:16:29 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/pgmoon/init.lua:547: missing database for connect
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/pgmoon/init.lua:547: in function ‘send_startup_message’
/usr/local/share/lua/5.1/pgmoon/init.lua:207: in function ‘connect’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:202: in function ‘connect’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:489: in function ‘query’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:270: in function ‘init’
/usr/local/share/lua/5.1/kong/db/init.lua:138: in function ‘init_connector’
/usr/local/share/lua/5.1/kong/init.lua:402: in function ‘init’
init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/pgmoon/init.lua:547: missing database for connect
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/pgmoon/init.lua:547: in function ‘send_startup_message’
/usr/local/share/lua/5.1/pgmoon/init.lua:207: in function ‘connect’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:202: in function ‘connect’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:489: in function ‘query’
…/share/lua/5.1/kong/db/strategies/postgres/connector.lua:270: in function ‘init’
/usr/local/share/lua/5.1/kong/db/init.lua:138: in function ‘init_connector’
/usr/local/share/lua/5.1/kong/init.lua:402: in function ‘init’
init_by_lua:3: in main chunk


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ