Not able to find Go in fabric-orderer container


Siddharth Jain
 

I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!


Nye Liu <nye@...>
 

/usr/bin/go, /usr/local/bin/go, and /usr/lib/go-x.xx/bin/go are all more likely than /usr/local/go


On Fri, Oct 25, 2019, 1:32 PM Siddharth Jain <siddjain@...> wrote:
I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!


Siddharth Jain
 

root@c754367ff2ba:/home# go
bash: go: command not found
root@c754367ff2ba:/home# ls /usr/bin/go
ls: cannot access '/usr/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/bin/go
ls: cannot access '/usr/local/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib/go*
ls: cannot access '/usr/lib/go*': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib
apt       gcc      locale          os-release  ssl      tmpfiles.d
binfmt.d  gnupg    mime            python2.7   systemd  x86_64-linux-gnu
dpkg      insserv  modules-load.d  python3     tar

its just not there! 


From: Nye Liu <nye@...>
Sent: Friday, October 25, 2019 1:46 PM
To: Siddharth Jain <siddjain@...>
Cc: fabric@... <fabric@...>
Subject: Re: [Hyperledger Fabric] Not able to find Go in fabric-orderer container
 
/usr/bin/go, /usr/local/bin/go, and /usr/lib/go-x.xx/bin/go are all more likely than /usr/local/go

On Fri, Oct 25, 2019, 1:32 PM Siddharth Jain <siddjain@...> wrote:
I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!


Nye Liu <nye@...>
 

The go binary is not needed in that container, it is only needed to build it.


You misapprehend what the go image is used for.


On 10/25/2019 2:01 PM, Siddharth Jain wrote:

root@c754367ff2ba:/home# go
bash: go: command not found
root@c754367ff2ba:/home# ls /usr/bin/go
ls: cannot access '/usr/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/bin/go
ls: cannot access '/usr/local/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib/go*
ls: cannot access '/usr/lib/go*': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib
apt       gcc      locale          os-release  ssl      tmpfiles.d
binfmt.d  gnupg    mime            python2.7   systemd  x86_64-linux-gnu
dpkg      insserv  modules-load.d  python3     tar

its just not there! 


From: Nye Liu <nye@...>
Sent: Friday, October 25, 2019 1:46 PM
To: Siddharth Jain <siddjain@...>
Cc: fabric@... <fabric@...>
Subject: Re: [Hyperledger Fabric] Not able to find Go in fabric-orderer container
 
/usr/bin/go, /usr/local/bin/go, and /usr/lib/go-x.xx/bin/go are all more likely than /usr/local/go

On Fri, Oct 25, 2019, 1:32 PM Siddharth Jain <siddjain@...> wrote:
I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!


Siddharth Jain
 

Go does exist in the parent docker image of the orderer i.e., hyperledger/fabric-baseimage
root@2c068c753e05:/# find . -name go
./opt/go
./opt/go/bin/go
./opt/go/misc/tour/static/lib/codemirror/mode/go
./opt/go/pkg/linux_amd64/go
./opt/go/pkg/linux_amd64_race/go
./opt/go/src/cmd/go
./opt/go/src/go
and I don't see any code in the Dockerfile of the orderer where it is removed (uninstalled)


From: Nye Liu <nye@...>
Sent: Friday, October 25, 2019 2:10 PM
To: Siddharth Jain <siddjain@...>
Cc: fabric@... <fabric@...>
Subject: Re: [Hyperledger Fabric] Not able to find Go in fabric-orderer container
 

The go binary is not needed in that container, it is only needed to build it.


You misapprehend what the go image is used for.


On 10/25/2019 2:01 PM, Siddharth Jain wrote:
root@c754367ff2ba:/home# go
bash: go: command not found
root@c754367ff2ba:/home# ls /usr/bin/go
ls: cannot access '/usr/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/bin/go
ls: cannot access '/usr/local/bin/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib/go*
ls: cannot access '/usr/lib/go*': No such file or directory
root@c754367ff2ba:/home# ls /usr/lib
apt       gcc      locale          os-release  ssl      tmpfiles.d
binfmt.d  gnupg    mime            python2.7   systemd  x86_64-linux-gnu
dpkg      insserv  modules-load.d  python3     tar

its just not there! 


From: Nye Liu <nye@...>
Sent: Friday, October 25, 2019 1:46 PM
To: Siddharth Jain <siddjain@...>
Cc: fabric@... <fabric@...>
Subject: Re: [Hyperledger Fabric] Not able to find Go in fabric-orderer container
 
/usr/bin/go, /usr/local/bin/go, and /usr/lib/go-x.xx/bin/go are all more likely than /usr/local/go

On Fri, Oct 25, 2019, 1:32 PM Siddharth Jain <siddjain@...> wrote:
I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!


Alexandre Pauwels
 

Hey Siddharth,
If you're trying to debug the peer binary, I would recommend eschewing the docker containers entirely and just running the peer binary directly on your computer, and using the standard methods for using gdb to debug go.

Alex


On Fri, Oct 25, 2019 at 4:32 PM Siddharth Jain <siddjain@...> wrote:
I logged into a fabric-orderer:1.4.3 container and cannot find Go in it.
root@c754367ff2ba:/home# echo $GOPATH

root@c754367ff2ba:/home# ls /go
ls: cannot access '/go': No such file or directory
root@c754367ff2ba:/home# ls /usr/local/go
ls: cannot access '/usr/local/go': No such file or directory
root@c754367ff2ba:/home# ls /opt/gopath
ls: cannot access '/opt/gopath': No such file or directory

I checked the Dockerfile and looks like fabric-orderer is derived from a Go image. Then why is Go missing in it?! What happened!