registry

package
v1.5.0-rc11 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DockerPath = "docker"
	SkopeoPath = "skopeo"
)
View Source
var RunCommandFunc u.RunCmdFuncType = nil

RunCommandFunc specifies the custom function to run command for registry.

Only used for testing purpose!

Functions

func CreateHarborProject

func CreateHarborProject(name, url, username, passwd string) error

CreateHarborProject creates project for harbor v2

func DockerBuildx

func DockerBuildx(args ...string) error

DockerBuildx executes 'docker buildx args...' command

func DockerLogin

func DockerLogin(url, username, password string) error

DockerLogin executes 'docker login <registry> --username=<user> --password-stdin'

func GetDockerPasswdByConfig

func GetDockerPasswdByConfig(r string, cf io.Reader) (
	user, passwd string, err error)

func GetDockerPassword

func GetDockerPassword(url string) (
	username, passwd string, err error)

GetDockerPassword will try to find docker password from cache, if not found, it will try to find password from docker config. if passwd found in docker config, it will cache the password. if not found, return error

func GetDockerPasswordFromCache

func GetDockerPasswordFromCache(url string) (
	username, passwd string, err error)

GetDockerPasswordFromCache gets docker password from cache

func GetLoginToken

func GetLoginToken(url string, username string, passwd string) (string, error)

func SelfCheckBuildX

func SelfCheckBuildX() error

func SelfCheckDocker

func SelfCheckDocker() error

func SelfCheckSkopeo

func SelfCheckSkopeo() error

SelfCheck checks the registry related commands is installed or not

func SkopeoCopy

func SkopeoCopy(src, dst string, args ...string) error

SkopeoCopy execute the `skopeo copy ${source} ${destination} args...` cmd You can add custom parameters in `args`

func SkopeoInspect

func SkopeoInspect(img string, args ...string) (string, error)

InspectRaw function executs `skopeo inspect ${img}` command and return the output if execute successfully

func SkopeoLogin added in v1.5.0

func SkopeoLogin(url, username, password string) error

SkopeoLogin executes 'skopeo login <registry> --username=<user> --password-stdin'

Types

type DockerCredDesktopOutput

type DockerCredDesktopOutput struct {
	ServerURL string `json:"ServerURL"`
	Username  string `json:"Username"`
	Secret    string `json:"Secret"`
}

type DockerPasswordCache

type DockerPasswordCache struct {
	Username string
	Password string
	Registry string
}

type HarborProjectMetadataTemplate

type HarborProjectMetadataTemplate struct {
	Public string `json:"public"`
}

type HarborProjectTemplate

type HarborProjectTemplate struct {
	ProjectName string                        `json:"project_name"`
	Metadata    HarborProjectMetadataTemplate `json:"metadata"`
}

Jump to

Keyboard shortcuts

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