build: fix static linking in distroless dockerfile#261
Conversation
|
@matheusfm could you please take a look, thanks! 🙏 |
mccutchen
left a comment
There was a problem hiding this comment.
Yikes, thank you for the fix!
I've neglected this Dockerfile since #244, which uses Dockerfile.release via goreleaser. I need to figure out how to unify the two, this is a good reminder.
| @@ -1,5 +1,5 @@ | |||
| # syntax = docker/dockerfile:1.3 | |||
| FROM golang:1.26 AS build | |||
| FROM golang:1.26.4 AS build | |||
There was a problem hiding this comment.
I'm a little conflicted about this — it pins to the latest stable release today but will quickly become a pin to an outdated stable release.
The choice of 1.26 was intentional, making it possible to track the latest stable release as it changes over time. There are definitely tradeoffs, though, as the current approach might require explicitly running docker pull golang:1.26 to make sure you're actually building on the latest stable release.
My inclination would be to drop this change, in part so that I don't have to keep updating it myself.
There was a problem hiding this comment.
Thanks for the review, Ok - if you want me remove Dockerfile change and want to merge just Makefile, open to do that, thanks!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #261 +/- ##
==========================================
- Coverage 94.96% 94.81% -0.15%
==========================================
Files 9 9
Lines 2027 2027
==========================================
- Hits 1925 1922 -3
- Misses 59 62 +3
Partials 43 43 🚀 New features to boost your workflow:
|
Summary
golang:1.26.4(wasgolang:1.26) for the latest stable Go.Makefilebuild target: drop the stray;afterCGO_ENABLED=0. The semicolon made it a non-exported shell var, sogo builddefaulted to CGO enabled and produced a dynamically-linked binary — which fails on distroless withexec /bin/go-httpbin: no such file or directory. Now statically linked.