vouch / vouch-proxy

an SSO and OAuth / OIDC login solution for Nginx using the auth_request module
MIT License
2.88k stars 326 forks source link

docker build fails with golang image version `golang:1.18` #530

Closed nilskch closed 3 months ago

nilskch commented 1 year ago

First of all thank you very much for this awesome tool! I created a fork to return customised error html pages (#420) but ran into a problem.

Docker build commands (./do.sh dbuild and ./do.sh dbuildalpine) fail with this error message.

The command '/bin/sh -c ./do.sh gobuildstatic # see `do.sh` for vouch-proxy build details
returned a non-zero code: 2

and if you take a look at the logs you can see:

/go/pkg/mod/go.uber.org/multierr@v1.11.0/error.go:209:20: undefined: atomic.Bool
note: module requires Go 1.19

Changing the image in the Dockerfile and Dockerfile.alpine from version golang:1.18 to golang:1.20 fixes the problem.

I am happy to create a PR if you want.

blalop commented 1 year ago

I'm running into the same issue with the bare metal installation, had to upgrade to Go 1.19.

However, I'm not quite sure why this is happening, as the indirect dependency is locked in go.mod: https://github.com/vouch/vouch-proxy/blob/v0.39.0/go.mod#L47

wrongecho commented 1 year ago

Also running into this when compiling from source & running binary.

CaptainPseudo commented 1 year ago

./do.sh goget seems to update go.mod and change the version for atomic and multierr to 1.11.0. My local go.mod file after running goget reads

        go.uber.org/atomic v1.11.0 // indirect
        go.uber.org/multierr v1.11.0 // indirect
Shadetheartist commented 1 year ago

i had the same issue when compiling from source with the Dockerfile & docker compose. Upgrading to go 1.20 fixed it for me.