GoogleCloudPlatform / traffic-director-grpc-bootstrap

Apache License 2.0
20 stars 18 forks source link

Use non-Alpine image on Cloud Build CI #30

Closed ejona86 closed 2 years ago

ejona86 commented 2 years ago

This fixes a regression introduced in 9f045adb that broke the Cloud Build CI:

Step #0: go: missing Git command. See https://golang.org/s/gogetcmd
Step #0: error obtaining VCS status: exec: "git": executable file not found in $PATH
Step #0:    Use -buildvcs=false to disable VCS stamping.

In Go 1.18 the Go command will invoke the git command to include VCS information inside the binary. We want that functionality, so we don't want to pass -buildvcs=false. The non-Alpine container includes the git command.

easwars commented 2 years ago

Is there a way to install git through some GA step. The size difference between the alpine and non-alpine images is huge. Would be great if we can continue to use the alpine image.

ejona86 commented 2 years ago

It isn't that big of a difference vs normal Alpine. It is 100 vs 300 mb or something instead of the normal very small Alpine. Ideally the containers would be cached, so it is better to use a container that has what we need instead of install on every build. Also, Cloud Build is really not oriented toward installing things on demand.

easwars commented 2 years ago

It isn't that big of a difference vs normal Alpine. It is 100 vs 300 mb

I tried building some docker images: using scratch: 6.8 MB using golang:1.18-alpine: 335 MB using golang:1.18: 970 MB

Also, Cloud Build is really not oriented toward installing things on demand.

Ack