Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change go path explicitly on docker image

Tags:

docker

go

when I run dep ensure

/home/jenkins/workspace/myproject-voter is not within a known GOPATH/src

we have go installed on this docker image , I know that the project is not cloned to go/src but my question is if via set env or something I can do some trick to overcome this issue ?

like image 468
Rayn D Avatar asked Sep 06 '25 10:09

Rayn D


1 Answers

my question is if via set env or something I can do some trick to overcome this issue ?

Not "set env", but ENV:

ENV GOPATH=/path/to/your/Go/project

That would ensure any Go command is using the right workspace.

like image 127
VonC Avatar answered Sep 08 '25 23:09

VonC