docker

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DOCKER_URL  = "https://registry-1.docker.io"
	SETTING_URL = "https://raw.githubusercontent.com/JasonYangShadow/LPMXSettingRepository/master/v1.9"
)

Variables

This section is empty.

Functions

func DeleteManifest

func DeleteManifest(username string, pass string, name string, tag string) *Error

func DirectDownloadFilefromGithub

func DirectDownloadFilefromGithub(filename string, url string, folder string) *Error

url is github url

func DownloadBlob

func DownloadBlob(repository, token, sha256 string) (io.ReadCloser, *Error)

func DownloadFilefromGithub

func DownloadFilefromGithub(name string, tag string, filename string, url string, folder string) *Error

func DownloadFilefromGithubPlus

func DownloadFilefromGithubPlus(name, tag, filename, url, folder, yaml string) *Error

a patched version that could search file from different level and auto-select the closet one name: is the name of distro, tag: version of distro, filename: the target request file on github, url: fixed github prefix, folder: local folder saving downloaded file, yaml: yaml file saving distro info located on github

func DownloadLayers

func DownloadLayers(username string, pass string, name string, tag string, folder string) (map[string]int64, []string, *Error)

func GenGithubURLfromYaml

func GenGithubURLfromYaml(name, tag, url, yaml, target_file string) (string, *Error)

find correct download url based on the yaml description file

func GetDigest

func GetDigest(username string, pass string, name string, tag string) (string, *Error)

func GetToken

func GetToken(repository, username, password, action string) (string, *Error)

func HasBlob

func HasBlob(repository, token, sha256 string) (bool, *Error)

func ListRepositories

func ListRepositories(username string, pass string) ([]string, *Error)

func ListTags

func ListTags(username string, pass string, name string) ([]string, *Error)

func LoadDockerTar

func LoadDockerTar(dir, imagedir string) (string, map[string]int64, []string, *Error)

dir is temp dir used for tarball extraction, image dir is used for the storage of image data

func LoadSkopeoTar added in v1.8.1

func LoadSkopeoTar(dir, imagedir string) (map[string]int64, []string, *Error)

func MakeManifestV1

func MakeManifestV1(registry *registry.Registry, name, tag, layer_sha, base_image string) (*schema1.SignedManifest, *Error)

func UploadBlob

func UploadBlob(repository, token, file string) (bool, *Error)

func UploadLayers

func UploadLayers(username, pass, name, tag, file, base_image string) (string, *Error)

func UploadManifests

func UploadManifests(username, pass, name, tag, layer_sha, base_image string) *Error

Types

type DockerHubToken

type DockerHubToken struct {
	Token        string `json:"token"`
	Access_token string `json:"access_token"`
	Expire       int    `json:"expires_in"`
	Time         string `json:"issued_at"`
}

type DockerSaveInfo

type DockerSaveInfo struct {
	Config   string   //config json file name
	RepoTags []string //tag list
	Layers   []string //layers included inside this image, from lower to higher layers
}

Docker load image structure

type SkopeoManifest added in v1.8.1

type SkopeoManifest struct {
	SchemaVersion int                  `json:"schemaVersion"`
	MediaType     string               `json:"mediaType"`
	Config        SkopeoManifestItem   `json:"config"`
	Layers        []SkopeoManifestItem `json:"layers"`
}

Skopeo manifest structure

type SkopeoManifestItem added in v1.8.1

type SkopeoManifestItem struct {
	MediaType string `json:"mediaType"`
	Size      uint   `json:"size"`
	Digest    string `json:"digest"`
}

Skopeo manifest item structure

Jump to

Keyboard shortcuts

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