docker

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Google Cloud Platform authentication scope
	GoogleCloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)

Constants

Variables

This section is empty.

Functions

func Build

func Build(imageName, tag string, opts BuildOptions, useAI bool) error

func PushImage

func PushImage(opts PushOptions, useAI bool) error

PushImage pushes the specified Docker image to the Docker Hub. It authenticates with Docker Hub, tags the image, and pushes it to the registry. It displays a spinner with progress updates and prints the push response messages.

func PushImageToACR

func PushImageToACR(subscriptionID, resourceGroupName, registryName, imageName string, useAI bool) error

PushImageToACR pushes the specified Docker image to the specified Azure Container Registry. It authenticates with Azure, retrieves the registry details and credentials, tags the image, and pushes it to the registry. It displays a spinner with progress updates and prints the push response messages. Upon successful completion, it prints a success message with a link to the pushed image in the ACR.

func PushImageToECR

func PushImageToECR(imageName, region, repositoryName string, useAI bool) error

func PushImageToGCR

func PushImageToGCR(projectID, imageNameWithTag string, useAI bool) error

PushImageToGCR pushes image to Google Container Registry/Artifact Registry

func PushToGHCR added in v0.0.7

func PushToGHCR(opts PushOptions, useAI bool) error

Push to GitHub Container Registry (GHCR)

func RemoveImage

func RemoveImage(imageTag string, useAI bool) error

RemoveImage removes the specified Docker image from the local Docker daemon. It displays a spinner with progress updates and prints the removal response messages. Upon successful completion, it prints a success message with the removed image tag.

func TagImage

func TagImage(opts TagOptions, useAI bool) error

TagImage tags a Docker image with the specified source and target tags. It displays a spinner with progress updates and prints a success message upon completion.

func Trivy added in v0.0.6

func Trivy(dockerImage, format string, useAI bool) error

Trivy runs 'trivy image' to scan a Docker image for vulnerabilities and displays the results. It's a simplified version that accepts just the image name and tag.

format selects the output shape: "table" (default) keeps the existing pterm-wrapped human output; "json" asks trivy itself for JSON (via its own --format flag) and prints that document, and nothing else, to stdout, so pipelines consuming stdout only ever see it.

func VerifyGCloudAuth added in v0.0.9

func VerifyGCloudAuth() error

VerifyGCloudAuth maintains backward compatibility

Types

type AuthProvider added in v0.0.9

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

AuthProvider handles Google Cloud authentication

func NewAuthProvider added in v0.0.9

func NewAuthProvider() *AuthProvider

func (*AuthProvider) VerifyGCloudAuth added in v0.0.9

func (a *AuthProvider) VerifyGCloudAuth() error

VerifyGCloudAuth verifies Google Cloud authentication with multiple fallbacks

type BuildOptions

type BuildOptions struct {
	ContextDir     string
	DockerfilePath string
	BuildArgs      map[string]string
	Target         string
	Platform       string
	NoCache        bool
	BuildKit       bool
	Timeout        time.Duration
	Excludes       []string
	Labels         map[string]string
}

BuildOptions contains configuration for the Docker build

type ColorfulLogger added in v0.0.6

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

func NewColorfulLogger added in v0.0.6

func NewColorfulLogger() *ColorfulLogger

type ECRLogger added in v0.0.6

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

func NewECRLogger added in v0.0.6

func NewECRLogger() *ECRLogger

type ImageInfo added in v0.0.4

type ImageInfo struct {
	ID       string
	Size     int64
	Created  time.Time
	Platform string
	Layers   int
	Tag      string
}

ImageInfo struct to hold information about a Docker image

type PushOptions

type PushOptions struct {
	ImageName string
	Timeout   time.Duration
}

PushOptions struct to hold options for pushing a Docker image

type TagOptions

type TagOptions struct {
	Source string
	Target string
}

TagOptions struct to hold options for tagging a Docker image

Jump to

Keyboard shortcuts

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