Skip to content

feat(examples): Add hugo0.147 base distroless - #354

Open
CKCatalin wants to merge 2 commits into
unikraft:mainfrom
CKCatalin:feat/add-hugo0.147-base-distroless
Open

CKCatalin wants to merge 2 commits into
unikraft:mainfrom
CKCatalin:feat/add-hugo0.147-base-distroless

Conversation

@CKCatalin

Copy link
Copy Markdown

Description

Added a Hugo base example using the distroless container image gcr.io/distroless/cc-debian12, which provides a minimal runtime environment. This example utilizes a multi-stage build, starting with golang:1.21.3-bookworm to compile the Hugo static site generator with PIE support (-buildmode=pie), bootstraps a new site using the ananke theme, and selectively copies the compiled /go/bin/hugo binary and the generated site files into the final distroless image.

The README.md file contains instructions for building and running the example manually.

Automated Testing

This PR contains a three-stage workflow to build and test this example via GitHub Actions:

  1. Measuring the rootfs size (resulting in 144MB)
  2. Scanning for vulnerabilities using Trivy
  3. Validating the web application operations using curl and matching the HTTP 200 status code

Note on Vulnerability Scanning:

Trivy scans are configured to pass by explicitly ignoring specific vulnerabilities via .trivyignore. An extensive list of CVEs and GHSAs (including CVE-2026-14456 and various Go/dependency-specific security alerts) are ignored. This is safe as they affect features, upstream libraries, or Debian components that this simple local static site server does not implement, utilize, or expose in its minimal execution environment.

Use cc-debian12 distroless image for full compatibility with dynamically linked C/C++ dependencies required by Hugo Extended. It includes glibc and libstdc++ to support the CGO build.

Signed-off-by: Constantin-Cătălin Cojocaru <catalincojocaru4@gmail.com>
- Measure root file system size using du -sh
- Scan for vulnerabilities using Trivy
- Validate output using curl and grep

Signed-off-by: Constantin-Cătălin Cojocaru <catalincojocaru4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant