internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAndPushImage

func BuildAndPushImage(cli DockerClient, ctx context.Context, imageName, imageTag, registryURL, username, password string, bar *progressbar.ProgressBar) error

BuildAndPushImage builds and pushes a Docker image to the specified registry

func CreateDockerfileTemplate

func CreateDockerfileTemplate(baseImage string, additional []string) error

CreateDockerfileTemplate generates a Dockerfile using Go templating

func EncodeAuthConfig

func EncodeAuthConfig(authConfig types.AuthConfig) (string, error)

EncodeAuthConfig encodes Docker authentication configuration as a base64 JSON string.

func GetDockerCredentials

func GetDockerCredentials(registryURL string) (string, string, error)

GetDockerCredentials checks if the registry credentials are stored locally and decodes them.

Types

type AuthConfig

type AuthConfig struct {
	Auth string `json:"auth"` // This is the base64 encoded username:password
}

AuthConfig holds the authentication data for a Docker registry

type DockerClient

type DockerClient interface {
	ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
	ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error)
}

DockerClient is an interface representing methods used from the Docker SDK client.

type DockerConfig

type DockerConfig struct {
	Auths map[string]AuthConfig `json:"auths"`
}

DockerConfig holds the configuration for Docker authentication

type DockerfileData

type DockerfileData struct {
	BaseImage string
	Args      []string
}

DockerfileData holds the fields for the Dockerfile template

Directories

Path Synopsis
Package internal/mocks is a generated GoMock package.
Package internal/mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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