mirror of
https://github.com/enix/x509-certificate-exporter.git
synced 2026-08-23 22:16:39 +00:00
38 lines
1.9 KiB
Go
38 lines
1.9 KiB
Go
package main
|
|
|
|
import (
|
|
"dagger/x-509-ce/internal/dagger"
|
|
)
|
|
|
|
// Pinned image versions. Renovate's `regex` manager (configured in
|
|
// renovate.json5) tracks the `<name>Image = "..."` literals here.
|
|
const (
|
|
golangImage = "golang:1.26.3-alpine@sha256:91eda9776261207ea25fd06b5b7fed8d397dd2c0a283e77f2ab6e91bfa71079d"
|
|
alpineImage = "alpine:3.23.4@sha256:5b10f432ef3da1b8d4c7eb6c487f2f5a8f096bc91145e68878dd4a5019afde11"
|
|
helmImage = "alpine/helm:4.2.0@sha256:af08f75a3130d666a50b9fc150f40987ef20b885cf67659aabf4b83a5f2c5501"
|
|
renovateImage = "renovate/renovate:43.180.1@sha256:003b1706c1432d2c3fcb698e30e3274616bc8936e36e43eb1761461ea2409d29"
|
|
helmDocsImage = "jnorwood/helm-docs:v1.14.2@sha256:7e562b49ab6b1dbc50c3da8f2dd6ffa8a5c6bba327b1c6335cc15ce29267979c"
|
|
helmSchemaImage = "ghcr.io/dadav/helm-schema:0.23.2@sha256:4807d868cb489e8160e0cece1aba51d2101a9c307b76bdda4f88929c75bd5c29"
|
|
markdownlintImage = "davidanson/markdownlint-cli2:v0.22.1@sha256:0ed9a5f4c77ef447da2a2ac6e67caf74b214a7f80288819565e8b7d2ac148fe5"
|
|
trivyImage = "aquasec/trivy:0.70.0@sha256:be1190afcb28352bfddc4ddeb71470835d16462af68d310f9f4bca710961a41e"
|
|
golangciLint = "v2.12.2" // installed via `go install`
|
|
gotestsumModule = "v1.13.0" // ditto
|
|
govulncheckPath = "latest" // tracking latest, no Renovate pin
|
|
)
|
|
|
|
// goBase returns a base Go container with go.mod/sum prefetched and
|
|
// build/module caches mounted. Every Go-flavoured method starts here.
|
|
func goBase(source *dagger.Directory) *dagger.Container {
|
|
return dag.Container().
|
|
From(golangImage).
|
|
WithEnvVariable("GOTOOLCHAIN", "auto").
|
|
WithEnvVariable("CGO_ENABLED", "0").
|
|
WithMountedCache("/go/pkg/mod", dag.CacheVolume("go-mod")).
|
|
WithMountedCache("/root/.cache/go-build", dag.CacheVolume("go-build")).
|
|
WithWorkdir("/src").
|
|
WithFile("/src/go.mod", source.File("go.mod")).
|
|
WithFile("/src/go.sum", source.File("go.sum")).
|
|
WithExec([]string{"go", "mod", "download"}).
|
|
WithDirectory("/src", source)
|
|
}
|