Documentation
¶
Index ¶
- func EncodeDockerAuthHeader(username, password string) (string, error)
- func IsCommitPinnedVersion(version string) bool
- func RegistryRequiresSingleSeparators(server string) bool
- func SecretRegistry(reg docker.RegistryArgs) docker.RegistryArgs
- func ToLegacyRepositoryName(name string) string
- type Image
- type ImageOut
- type MsgCallback
- type MsgReader
- type Pull
- type PullArgs
- type ResponseAux
- type ResponseMessage
- type ResponseMessageV2
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeDockerAuthHeader ¶
func IsCommitPinnedVersion ¶
IsCommitPinnedVersion reports whether a version has the shape of a tag that names exactly one commit.
func RegistryRequiresSingleSeparators ¶
RegistryRequiresSingleSeparators reports whether a push to this registry has to go to a repository name with no doubled separators.
`server` is the registry URL as configured — it may carry a scheme and a path (`dockerRegistryURL: rusmokereg.cr.cloud.ru/foo`), so only the host is compared.
func SecretRegistry ¶
func SecretRegistry(reg docker.RegistryArgs) docker.RegistryArgs
SecretRegistry returns reg with its password marked secret. The docker provider does not mark registry.password secret, so a plain password (a registry token minted on every run) is stored in state as plaintext.
func ToLegacyRepositoryName ¶
ToLegacyRepositoryName rewrites a repository name to satisfy the legacy grammar described on legacyGrammarRegistrySuffixes.
Runs collapse to their first character (`a--b` -> `a-b`, `a__b` -> `a_b`) rather than being hashed or stripped, to keep the registry readable. Two stacks whose names differ only in the position of a doubled separator would collide, which is accepted: it takes deliberately adversarial naming to hit.
The Yandex driver carries its own copy of this (toRepositoryName, pulumi/yandex/docker.go) applied one layer up, where it also feeds the name it logs. The two encode the same registry grammar; this one is the general path and runs for every template, including the Yandex one — where it is then a no-op, because the name arrives already collapsed.
Types ¶
type Image ¶
type Image struct {
Name string
Dockerfile string
Args map[string]string
Context string
Version string
RepositoryUrlWithImage bool
ProviderOptions []sdk.ResourceOption
RepositoryUrl sdk.StringOutput
Registry docker.RegistryArgs
Platform *string
// CacheFrom is an optional list of registry image references to use as
// BuildKit layer cache sources (--cache-from). When set, BUILDKIT_INLINE_CACHE=1
// is injected into build args so the pushed image embeds cache metadata.
//
// SLSA L3 hermeticity note: CacheFrom pulls layers from the registry, which
// technically breaks strict build hermeticity. This is an accepted deviation —
// all post-push security operations use the immutable content digest, so the
// cache source cannot affect signing or attestation integrity.
CacheFrom sdk.StringArrayInput
}
Image describes a container image to build and push via Pulumi.
type ImageOut ¶
type ImageOut struct {
Image *docker.Image
AddOpts []sdk.ResourceOption
// DeployImageRef is the reference a runtime should be pointed at. It is the
// immutable digest whenever one is available, so that what runs is what was
// scanned, signed and verified rather than whatever the tag points at by the
// time the runtime pulls.
DeployImageRef sdk.StringOutput
}
ImageOut is the result of BuildAndPushImage.
func BuildAndPushImage ¶
func BuildAndPushImage(ctx *sdk.Context, stack api.Stack, params pApi.ProvisionParams, deployParams api.StackParams, image Image) (*ImageOut, error)
BuildAndPushImage builds a Docker image, pushes it, and runs security operations (scan, sign, verify, SBOM, provenance) in parallel.
The service update (ECS task definition / K8s deployment) depends on ImageOut.AddOpts, which gates on sign+verify — not on scan. Scan runs parallel and reports findings without blocking the deploy.
type MsgCallback ¶
type MsgCallback func(message *ResponseMessage, err error) error
MsgCallback callback to be called for each message from Docker daemon
type MsgReader ¶
type MsgReader interface {
// Next synchronously reads next message from Docker daemon
Next() (*ResponseMessage, error)
// Listen allows to process messages streamed from Docker daemon
Listen(output bool, callback MsgCallback) error
}
MsgReader interface allowing to read streamed output from Docker daemon
type Pull ¶
type Pull struct {
sdk.ResourceState
Digest sdk.StringOutput `pulumi:"digest"`
}
func NewDockerPull ¶
type PullArgs ¶
type PullArgs struct {
RemoteImage sdk.StringInput `pulumi:"remoteImage"`
AuthHeader sdk.StringInput `pulumi:"authHeader"`
Platform sdk.StringInput `pulumi:"platform"`
Log logger.Logger
}
type ResponseAux ¶
type ResponseMessage ¶
type ResponseMessage struct {
Id string `json:"id"`
Status string `json:"status"`
Stream string `json:"stream"`
Aux ResponseAux `json:"aux"`
ErrorDetail struct {
Code int `json:"code"`
Message string `json:"message"`
}
ProgressDetail struct {
Current int `json:"current"`
Total int `json:"total"`
}
Progress string `json:"progress"`
Error string `json:"error"`
// contains filtered or unexported fields
}
ResponseMessage reflects typical response message from Docker daemon of V1
type ResponseMessageV2 ¶
type ResponseMessageV2 struct {
Id string `json:"id"`
Aux string `json:"aux"` // contains base64-encoded PB object
}
ResponseMessageV2 reflects typical response message from Docker daemon of V2