docker

package
v0.0.7-Beta Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

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

func PushImage

func PushImage(opts PushOptions) 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) 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) error

func PushImageToGCR

func PushImageToGCR(projectID, imageNameWithTag string) error

func RemoveImage

func RemoveImage(imageTag string) 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) 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 string) 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.

Types

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