I am trying to compile kaniko on a raspberry pi.
I don't program in golang, but I was able to compile kaniko successfully a few weeks ago on the same raspberry pi, and I even wrote myself a guide on the steps to follow, but now, following the same steps, something is broken.
kaiko requires go , but a newer version of go in the raspberry pi repositories, so I download and install go from scratch. go requires go build, so I first install it (an older version) from the repositories, and then remove it after it finishes building a newer version of itself:
Install go :
sudo apt-get install golang wget https://dl.google.com/go/go1.17.6.src.tar.gz tar -xvf go1.17.6.src.tar.gz cd go/src ./make.bash sudo apt-get purge golang golang-go sudo mv -v ../bin/* /usr/local/bin echo 'export GOPATH=~/.go' >> ~/.profile echo 'export GOROOT=/usr/local/bin' >> ~/.profile source ~/.profileCompile kaniko:
sudo apt-get install git git clone https://github.com/GoogleContainerTools/kaniko.git cd kaniko makeBased on the comments, my suggestion is to add $HOME/go/bin to the path and use the default GOPATH.
Go mod depends on the bin directory inside GOPATH. Install new packages there. The go binary itself can reside elsewhere. If you follow these installation instructions https://go.dev/doc/install , go will actually be /usr/local/go but GOPATH is still $HOME/go .
I would also recommend not involving apt in this at all. This seems like a problem in the form of conflicts with different installations.