Arcane Builds is the standalone Go module behind Arcane's image build flow. It provides the build engine, Docker Engine BuildKit integration, direct local BuildKit sessions, Depot BuildKit provider integration, registry auth wiring, build progress events, log capture, and reusable helper packages.
The module can be used directly in non-Arcane Go applications. Arcane-specific build history, activity logging, Git credential lookup, remote Git clone/probe/cleanup, and pagination remain host-application behavior. The build engine expects a local build context directory by the time BuildImage is called.
Using Arcane Builds is a small image build flow:
- Create an
api.Servicewithapi.Config. - Provide a
SettingsProvider, aDockerClientProvider, and optionally aRegistryAuthProvider. - Call
BuildImagewith atypes.BuildRequest, progress writer, and optional service name. - The service resolves the effective provider from the request override or host settings.
- Local builds use the Docker Engine BuildKit API, with a direct BuildKit session for Dockerfiles that require session-backed features.
- BuildKit builds stream status as NDJSON
types.ProgressEventpayloads and can load, push, or export image results depending on request options. - Registry auth configs are passed through to Docker build, BuildKit sessions, and image push operations.
- Results are returned as
types.BuildResult.
The build engine does not own durable persistence, Git repository credentials, remote Git checkout, user notifications, scheduling, or build history. Those can be added by the host application around the service.
go get go.getarcane.app/builds@latesttype settingsProvider struct{}
func (settingsProvider) BuildSettings() types.BuildSettings {
return types.BuildSettings{
BuildProvider: "local",
BuildTimeoutSecs: 1800,
}
}
svc := api.NewService(api.Config{
SettingsProvider: settingsProvider{},
DockerClientProvider: dockerProvider,
RegistryAuthProvider: registryProvider,
})
result, err := svc.BuildImage(ctx, types.BuildRequest{
ContextDir: "/workspace/app",
Dockerfile: "Dockerfile",
Tags: []string{"example/app:latest"},
Load: true,
}, progressWriter, "app")For remote Git build contexts, parse the source with pkg/utils/contextsource, clone or prepare the repository in the host application, then pass the resolved local directory to BuildImage.
api: public build service, adapter interfaces, provider selection, build execution, and log capture.types: stable public DTOs for build settings, requests, results, progress events, and build-specific errors.pkg/utils/contextsource: Git build context parsing, validation, repository URL normalization, and probe detection helpers.pkg/utils/docker: Docker BuildKit client options and Docker JSON message stream draining.
go test ./...
gofmt -w .
golangci-lint run ./...Arcane Builds is released under the BSD 3-Clause License.