Title: fix: Build the Go feature server image in two stages by NopeCharon · Pull Request #7066 · feast-dev/feast · GitHub
Open Graph Title: fix: Build the Go feature server image in two stages by NopeCharon · Pull Request #7066 · feast-dev/feast
X Title: fix: Build the Go feature server image in two stages by NopeCharon · Pull Request #7066 · feast-dev/feast
Description: What this PR does / why we need it:
The go-feature-server image is built and published straight from the full golang:1.26 image. Every tag therefore ships the Go toolchain, gcc, protoc, the module and build caches, and Debian development packages such as linux-libc-dev. Scanners flag that package for DSA-6238-1, DSA-6253-1, DSA-6274-1 and DSA-6295-1. Users can't remediate it because it comes from the base layer.
This PR turns the Dockerfile into a two-stage build:
Builder stage: the existing steps (protoc install, proto generation, go build), unchanged. The base is pinned to golang:1.26-trixie, which is what golang:1.26 resolves to today.
Runtime stage: debian:trixie-slim with ca-certificates, plus the compiled feast binary. The binary is cgo-linked (go-sqlite3), so the runtime uses the same Debian release as the builder to get a matching glibc.
These stay the same: the working directory /app, the binary path ./feast, the exposed port and the default command. Existing deployments that mount the feature repo under /app or pass --chdir keep working.
Result (linux/arm64 build):
before (single stage)
after
image size
~3.1 GB
~214 MB
linux-libc-dev
6.12.113-1
not installed
Go toolchain / gcc / protoc
present
absent
ldd ./feast in the runtime image shows only libc.so.6 and the dynamic loader.
Which issue(s) this PR fixes:
Fixes #7060
Checks
I've made sure the tests are passing.
My commits are signed off (git commit -s)
My PR title follows conventional commits format
Testing Strategy
Unit tests
Integration tests
Manual tests
Testing is not required for this change
Manual tests:
Built the image with docker buildx build -f go/infra/docker/feature-server/Dockerfile --load ..
Inside the image, checked ldd ./feast, dpkg -s linux-libc-dev (not installed), and that /usr/local/go, gcc and protoc are absent.
Ran ./feast --type=http --chdir=
Open Graph Description: What this PR does / why we need it: The go-feature-server image is built and published straight from the full golang:1.26 image. Every tag therefore ships the Go toolchain, gcc, protoc, the module ...
X Description: What this PR does / why we need it: The go-feature-server image is built and published straight from the full golang:1.26 image. Every tag therefore ships the Go toolchain, gcc, protoc, the module ...
Opengraph URL: https://github.com/feast-dev/feast/pull/7066
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3a275b86-d9e1-abe9-0800-0473812241eb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9496:1DDFF4:21DFAF:2F61E2:6AFE9555 |
| html-safe-nonce | 5e47ccaa8f43832316f2c07c6c9dbeb373c1fb18c076a1a08b7a1d21c7f468af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDk2OjFEREZGNDoyMURGQUY6MkY2MUUyOjZBRkU5NTU1IiwidmlzaXRvcl9pZCI6Ijc3NjkwOTY2MzYyMTAyNTUxODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a6bfbbd7501011a12a230a897edddbc7b8839b585ed644ceb0569c2fe1806fef |
| hovercard-subject-tag | pull_request:4986190438 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/7066/files |
| twitter:image | https://avatars.githubusercontent.com/u/115794254?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/115794254?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: The go-feature-server image is built and published straight from the full golang:1.26 image. Every tag therefore ships the Go toolchain, gcc, protoc, the module ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width