fix(docker): add curl to builder stage for utoipa-swagger-ui download#58
Conversation
- utoipa-swagger-ui build.rs downloads Swagger UI assets at compile time using curl as a fallback when the reqwest feature is not enabled - curl was only present in the runtime stage, causing the Docker image build to fail on the release workflow
There was a problem hiding this comment.
Code Review
This pull request adds curl to the list of packages installed in the Dockerfile. The reviewer suggests using the vendored feature of utoipa-swagger-ui in Cargo.toml instead of installing curl to download Swagger UI assets at compile time, which would eliminate compile-time network requests and remove the dependency on curl in the builder stage.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| libssl-dev \ | ||
| g++ \ | ||
| protobuf-compiler \ | ||
| curl \ |
There was a problem hiding this comment.
Instead of installing curl in the builder stage to download Swagger UI assets at compile time, consider enabling the vendored feature of utoipa-swagger-ui in your Cargo.toml (for example: utoipa-swagger-ui = { version = "9", features = ["axum", "vendored"] }). This embeds the Swagger UI assets directly, which eliminates compile-time network requests to GitHub, removes the dependency on curl in the builder stage, and enables offline/air-gapped builds.
Problem
The
Publish Docker Imageworkflow was failing duringcargo build --releasewith:Root Cause
utoipa-swagger-ui v9.0.2downloads the Swagger UI zip from GitHub at compile time in itsbuild.rs. It tries two methods:reqwestfeature → not enabled (Err(NotPresent))curlbinary → not present in the builder imagecurlwas only installed in the runtime (debian:bookworm-slim) stage, not in the builder (rust:1.90-slim) stage.Fix
Added
curlto the builder stageapt-get install.References
Failing run: https://github.com/zvectorlabs/zradar/actions/runs/28687661442