我如何安装pg96在docker问密码和错误?

我已经按照这个https://www.openscg.com/bigsql/package-manager/但在最后的命令如何给密码

我想通过pgc安装pg96。

每件事情工作正常pgc安装在我的syatem,但是当我想安装pg96它是给错误和线索。

步骤18/19:RUN ./pgc start pg96 —>在00938b13380c中运行

初始化pg96

Step 18/19 : RUN ./pgc start pg96 ---> Running in 00938b13380c ## Initializing pg96 ####################### /usr/lib64/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal. passwd = fallback_getpass(prompt, stream) Warning: Password input may be echoed. Superuser Password [password]: Traceback (most recent call last): File "/bigsql/pg96/init-pg96.py", line 112, in <module> pg_password = util.get_superuser_passwd() File "/bigsql/hub/scripts/util.py", line 1344, in get_superuser_passwd pg_pass1 = getpass.getpass(str("Superuser Password [password]: ")) File "/usr/lib64/python2.7/getpass.py", line 83, in unix_getpass passwd = fallback_getpass(prompt, stream) File "/usr/lib64/python2.7/getpass.py", line 118, in fallback_getpass return _raw_input(prompt, stream) File "/usr/lib64/python2.7/getpass.py", line 135, in _raw_input raise EOFError EOFError 

当我在做./pgc开始pg96

这是要求密码我如何给密码,因为我使用docker文件。

你至less有两种方法

1)您可以尝试将yes / no传送给您的安装脚本。

RUN sh -c '/bin/echo -e "yes\nyes\nyes\nno\nyes\nno" | your_script'

2)或者你可以尝试与预期

RUN apt-get install expect ADD install_script RUN install_script

其中install_script是

#!/usr/bin/expect set timeout 2 spawn "./your_script" expect "Question 1 :" { send "yes\n" } expect "Question 2 :" { send "no\n" } interact

这来自

https://forums.docker.com/t/dockerfile-how-to-answer-install-question-from-application/5240/2

我发现问题的答案是这样的。

Pg96使用Python脚本检查.pgpass文件,所以在安装后在pg96目录下创build一个.pgpass文件。

或者如果它没有得到该文件,那么它要求在命令提示符下input密码。

我的build议在文件夹pg96中创build一个文件.pgpass。

然后运行命令

./pgc开始pg96

谢谢