Menu

Embedding BuildKit, Syft, container-structure-test and hadolint into one static Go binary

#golang#redditgolang#tests#buildkit#test
Reading 0:00
15s threshold

I've been working on ContainerHive , a CLI for teams that maintain internal base images that depend on each other ( base → node → node-browsers , and so on). You drop Dockerfiles into flat directories, reference parents with FROM __hive__/base:1.0.0 , and it resolves the graph, builds, tests, generates SBOMs and writes the GitLab or GitHub CI pipeline for you.

The Go side might be more interesting here than the use case:

Everything is a library, not a shell-exec. The goal was one static binary with no runtime dependencies besides a BuildKit daemon:

moby/buildkit client for builds. It connects to any BuildKit instance: local, a shared cluster service or a k8s sidecar. ch dev buildkitd start can run one locally.

anchore/syft as a library for CycloneDX SBOMs

GoogleContainerTools/container-structure-test as a library for image tests

hadolint for Dockerfile linting.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.