Skip to content

Commit

Permalink
chore: pin golang image to latest (#957)
Browse files Browse the repository at this point in the history
* chore: pin golang image to latest

[#187010312](https://www.pivotaltracker.com/story/show/187010312)

* fix: pin golang alpine instead of latest

[#187010312](https://www.pivotaltracker.com/story/show/187010312)

`golang:latest` is based on debian instead of alpine. Since we were using golang:1.22.0-alpine before we should keep using latest version of alpine `golang:alpine`.

This Dockerfile definitely needs Alpine since we perform some APK operations: #957

Also, we must keep in mind that there might be differences in the golang binaries, since Alpine binaries tend to be statically linked against MUSL instead of glibc: golang/go#62053

We might want to keep an eye on this topic to ensure our binaries are always built in a consistent way.

Thank you very much @zucchinidev 🥇 for noticing this error and letting me know :)

Keep up the good work!

Co-authored-by: Andrea Zucchini <[email protected]>

* fix: allow downloading go toolchains on-the-fly

[#187010312](https://www.pivotaltracker.com/story/show/187010312)

Golang Docker images come with `GOTOOLCHAIN=local` by default which prevents downloading toolchains on-the-fly.
This would cause our CI to fail for a few hours when a new go version is released but golang tags are not yet up-to-date with it.
https://github.com/search?q=repo%3Adocker-library%2Fgolang%20GOTOOLCHAIN&type=code

---------

Co-authored-by: Andrea Zucchini <[email protected]>
  • Loading branch information
fnaranjo-vmw and zucchinidev authored Feb 20, 2024
1 parent 247f86d commit 8d9e873
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.22-alpine3.19 AS build
FROM golang:alpine AS build
# Golang Docker images come with `GOTOOLCHAIN=local` by default which prevents downloading toolchains on-the-fly.
# This would cause our CI to fail for a few hours when a new go version is released but golang tags are not yet up-to-date with it.
# https://github.com/search?q=repo%3Adocker-library%2Fgolang%20GOTOOLCHAIN&type=code
ENV GOTOOLCHAIN=
RUN apk update
RUN apk upgrade
RUN apk add --update gcc g++
Expand Down

0 comments on commit 8d9e873

Please sign in to comment.