0

I have followed this https://www.openscg.com/bigsql/package-manager/ but on last command how to give password

I want to install pg96 by pgc .

Every thing worked fine pgc is installed in my syatem but when i want to install pg96 it is giving error and clue.

Step 18/19 : RUN ./pgc start pg96 ---> Running in 00938b13380c

Initializing 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

When i am doing ./pgc start pg96

It is asking for password how can i give password as i am using docker file.

Himanshu sharma
  • 7,487
  • 4
  • 42
  • 75

2 Answers2

0

You have at least 2 ways

1) You can try to pipe the yes/no to your installation script.

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

2) or you can try too with expect

RUN apt-get install expect ADD install_script RUN install_script

where install_script is

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

This comes from

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

user2915097
  • 30,758
  • 6
  • 57
  • 59
0

The answer i found for the question is this.

Pg96 uses python script which check for either .pgpass file so create a file .pgpass in pg96 directory after install.

or if it don't get the file then it ask for password in command prompt.

My suggestion create a file .pgpass inside the folder pg96.

and then run command

./pgc start pg96

Thanks

Himanshu sharma
  • 7,487
  • 4
  • 42
  • 75