Skip to content

docker: single-arch (amd64) image published to GHCR + Docker Hub - #10

Closed
githubflyideas wants to merge 1 commit into
mainfrom
feat/docker-image
Closed

githubflyideas wants to merge 1 commit into
mainfrom
feat/docker-image

Conversation

@githubflyideas

Copy link
Copy Markdown
Owner

Adds the Docker image promised for before the end of 2026.

What is in here

  • Dockerfile — two stages. The build stage mirrors the release build in ci.yml exactly (Go 1.27.4, cgo, external link mode, fully static with the libstdc++ archive made findable and getentropy wrapped), so the image ships the same kind of binary as the tarball. The runtime stage is busybox with just the static binary; accounts and history live in /data (embedded DuckDB + Parquet), the Web UI is bound to all container interfaces via VYOS_SFLOW_ADDR, and a HEALTHCHECK polls /healthz.
  • .dockerignore — keeps the context small. Note docs/* is excluded except docs/embed.go and docs/MANUAL.md: the manual is compiled into the binary, so those two files must stay in the context.
  • .github/workflows/docker.yml — modelled on fogping's docker workflow, single-arch linux/amd64. Publishes to GHCR and Docker Hub on v* tags; on pull requests it only builds and smoke-tests (amd64 image is run, version output and /healthz status/version are asserted) without pushing.
  • README — new "Run with Docker" section: --network host as the recommended run (exporters reach UDP 6343 directly, no NAT in between), the /data volume, the port-published alternative, and the default-password warning. Placed as a ## section so the numbered quick-start steps the release contract pins stay untouched.

Verification

  • tests/release-contract.cjs passes.
  • No Docker daemon is available in my sandbox, so the image itself was not built here. Instead the Dockerfile build was reproduced step for step on the host (same Go version, same flags, context filtered by the new .dockerignore): the result is a statically linked binary (ldd: not a dynamic executable). That first reproduction is also how the docs/ embed requirement above was found.
  • The resulting binary was run with the image's environment (VYOS_SFLOW_ADDR=0.0.0.0:8066, VYOS_SFLOW_DATA=<dir>) and no terminal: it starts without the interactive prompt, serves /healthz as {"status":"ok","version":"1.3.5"}, listens on UDP 6343, and writes its DuckDB/Parquet data into the data directory.
  • The workflow YAML parses; the PR trigger on this pull request is the first real GitHub-side build check.

First publish

Merging this does not publish an image by itself: the workflow publishes on the next v* tag (or a manual dispatch). Publishing an image for the already-released 1.3.5 would need a new tag, e.g. shipping this with the next release.

Needs (same as fogping): repository variable DOCKERHUB_USER and secret DOCKERHUB_TOKEN for the Docker Hub push; GHCR works with the workflow token.

@githubflyideas

Copy link
Copy Markdown
Owner Author

Superseded: the Docker image shipped in v1.3.6 through the release flow instead — live on both GHCR (ghcr.io/githubflyideas/vyos-sflow) and Docker Hub (githubflyideas/vyos-sflow). Closing.

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