Closed ebuildy closed 6 years ago
Having the same issue
Here too. Really hacky, but I installed postgres through apt and removed sudo from the start and stop scrips and that seemed to get me going.
Could you try? $ docker run -it -p 8000:8000 steveny/predictionio:0.12.0 /bin/bash then $ pio-start-all thanks for feedback.
I also get this error but not with the 0.12.0 version command
@ebuildy @nloui @timsweb @poswald
The line pio-start-all: line 74
is to start postgres. The Dockerfile does not install postgres, so even after installing sudo
there will be error about postgres.
So you can ignore that error.
I am closing this issue. You can re-open if needed
The error happens because the binary you are trying to call from command line is only part of the current user's PATH variable, but not a part of root user's PATH.
You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call "bettercap-ng". So I ran,
$ which bettercap-ng
output: /home/user/work/bin/bettercap
I checked whether this location is part of my root user's PATH.
$ sudo env | grep ^PATH
output: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.
You can direct sudo to use the current user's PATH when calling a binary like below.
$ sudo -E env "PATH=$PATH" [command] [arguments]
In fact, one can make an alias out of it:
$ alias mysudo='sudo -E env "PATH=$PATH"'
It's also possible to name the alias itself sudo, replacing the original sudo.
Please refer to this video for step by step solution
@anandumdas thanks a lot for your detailed analysis. Could you create a pull-request so that I can merge your improvement to the code to the branch? thanks a lot.
Just run container as you said in REAME.md and got: