I forgot to add one more detail - the go-toolset image defaults to running
as user "default" (UID 1001).
Adding `USER root` right after the `FROM` declaration is another way to
work around the issue I described, but from a security perspective I would
advise against it.
On Mon, May 13, 2024 at 12
Great suggestion Jason - adding `git status` took me in a very unexpected
direction, and ultimately a solution.
tl;dr if your build's base container image does not use root/uid 0, git
commands won't work unless you add the `--chown=` flag to your `COPY`
instruction. Go builds need this if you want
> how can developers debug and find the root cause?
If it was me, I would start by going into the container (whatever the
podman equivalent of docker exec -it containernumber bash) and try to run
'git status' or 'git log' and see why the git query is giving an error.
You could also try strace