golang:1.10 mkdir /.cache/go-build/00: permission denied #225
see test project
No error for directly running docker command:
The error occurs when running in jenkins:
create a jenkins issue here: https://issues.jenkins-ci.org/browse/JENKINS-51964
I'm not so sure this should be closed so fast. This is pretty easy to reproduce without jenkens. You just need try to build anything using the
The problem is that go assumes (not unreasonably) that you will have write access to $XDG_CACHE_HOME if it exists and
It's even smart enough to turn off caching if $HOME=='', but unfortunately docker sets it to '/'
so go tries to mkdir
The fix is to set XDG_CACHE_HOME to something that is universally writable like
Alternatively, this could be fixed upstream if go were to disable caching when $HOME=='/' like it does for $HOME==''. I'll put in an issue to suggest it and see what they think.