containerregistry

package
v0.0.0-...-87586f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackRemoteBuildSource

func PackRemoteBuildSource(ctx context.Context, root string, dockerfile string) (string, string, error)

PackRemoteBuildSource creates a tarball of the specified context directory into a temporary file and returns the path to it. It ensures that the dockerfile is present in the tarball and returns the relative path of it in the archive. If the dockerfile is located outside of the context, it is added to the root of the archive with a unique prefix.

This tarball may be used as source input for the ACR Remote Build feature.

On error, if the archive had been created, the path is returned. The caller should ensure it is removed.

A `.dockerignore` file may be used to control what is included in the build context. If a file with the same path as `dockerfile` exists but with an additional `.dockerignore` suffix, it is used as the ignore file. Otherwise, if a `.dockerignore` file exists in the root of the context, it is used.

Any folders named `.git` is excluded from the produced archive.

Types

type RemoteBuildManager

type RemoteBuildManager struct {
	// contains filtered or unexported fields
}

RemoteBuildManager provides functionality to interact with the Azure Container Registry Remote Build feature.

func NewRemoteBuildManager

func NewRemoteBuildManager(
	credentialProvider account.SubscriptionCredentialProvider,
	armClientOptions *arm.ClientOptions,
) *RemoteBuildManager

func (*RemoteBuildManager) RunDockerBuildRequestWithLogs

func (r *RemoteBuildManager) RunDockerBuildRequestWithLogs(
	ctx context.Context,
	subscriptionID, resourceGroupName, registryName string,
	buildRequest *armcontainerregistry.DockerBuildRequest,
	writer io.Writer,
) error

RunDockerBuildRequestWithLogs initiates a remote build on the specified registry and streams the logs to the provided writer.

func (*RemoteBuildManager) UploadBuildSource

func (r *RemoteBuildManager) UploadBuildSource(
	ctx context.Context,
	subscriptionID string,
	resourceGroupName string,
	registryName string,
	buildSourcePath string,
) (armcontainerregistry.SourceUploadDefinition, error)

UploadBuildSource uploads the build source to the specified registry. The returned SourceUploadDefinition may be used when scheduling a build to reference the uploaded source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL