Documentation ¶
Overview ¶
credit: https://github.com/containrrr/watchtower
credit: https://github.com/containrrr/watchtower
credit: https://github.com/containrrr/watchtower
credit: https://github.com/containrrr/watchtower
credit: https://github.com/containrrr/watchtower
credit: https://github.com/containrrr/watchtower
Index ¶
- Constants
- Variables
- func BuildManifestURL(imageName string) (string, error)
- func CloneContainer(ctx context.Context, id string, newName string) (string, error)
- func CompareDigest(imageName string, repoDigests []string) (bool, error)
- func Container(ctx context.Context, id string) (*types.ContainerJSON, error)
- func ConvertToHostname(url string) (string, string, error)
- func CredentialsStore(configFile configfile.ConfigFile) credentials.Store
- func CurrentArchitecture() (string, error)
- func EncodeAuth(authConfig types.AuthConfig) (string, error)
- func EncodedAuth(ref string) (string, error)
- func EncodedConfigAuth(ref string) (string, error)
- func EncodedEnvAuth(ref string) (string, error)
- func ExtractImageAndTag(imageName string) (string, string)
- func GetArchitectures(imageName string, noCache bool) ([]string, error)
- func GetAuthURL(challenge string, img string) (*url.URL, error)
- func GetBearerHeader(challenge string, img string, registryAuth string) (string, error)
- func GetChallenge(imageName string) (string, error)
- func GetChallengeRequest(URL url.URL) (*http.Request, error)
- func GetChallengeURL(img string) (url.URL, error)
- func GetDigest(url string, token string) (string, error)
- func GetDir(id, envName string) string
- func GetManifest(ctx context.Context, imageName string) (interface{}, string, error)
- func GetPullOptions(imageName string) (types.ImagePullOptions, error)
- func GetScopeFromImageName(img, svc string) string
- func GetToken(challenge string, registryAuth string, imageName string) (string, error)
- func HasNewImage(ctx context.Context, imageName string, currentImageID string) (bool, string, error)
- func Image(ctx context.Context, imageName string) (*types.ImageInspect, error)
- func ImageName(containerInfo *types.ContainerJSON) string
- func IsDaemonRunning() bool
- func NormalizeRegistry(registry string) (string, error)
- func ParseServerAddress(ref string) (string, error)
- func PullImage(ctx context.Context, imageName string, handleOut func(io.ReadCloser)) error
- func RemoveContainer(ctx context.Context, id string) error
- func RenameContainer(ctx context.Context, id string, name string) error
- func StartContainer(ctx context.Context, id string) error
- func StopContainer(ctx context.Context, id string) error
- func TransformAuth(registryAuth string) string
- func WaitContainer(ctx context.Context, id string, condition container.WaitCondition) error
- type RegistryCredentials
- type TokenResponse
Constants ¶
const ChallengeHeader = "WWW-Authenticate"
ChallengeHeader is the HTTP Header containing challenge instructions
const ContentDigestHeader = "Docker-Content-Digest"
ContentDigestHeader is the key for the key-value pair containing the digest header
const NETWORKNAME = "oasis"
Variables ¶
var Cache *cache.Cache
Functions ¶
func BuildManifestURL ¶ added in v0.4.2
BuildManifestURL from raw image data
func CloneContainer ¶ added in v0.4.2
func CompareDigest ¶ added in v0.4.2
CompareDigest ...
func ConvertToHostname ¶ added in v0.4.2
ConvertToHostname strips a url from everything but the hostname part
func CredentialsStore ¶ added in v0.4.2
func CredentialsStore(configFile configfile.ConfigFile) credentials.Store
CredentialsStore returns a new credentials store based on the settings provided in the configuration file.
func CurrentArchitecture ¶ added in v0.4.2
func EncodeAuth ¶ added in v0.4.2
func EncodeAuth(authConfig types.AuthConfig) (string, error)
EncodeAuth Base64 encode an AuthConfig struct for transmission over HTTP
func EncodedAuth ¶ added in v0.4.2
EncodedAuth returns an encoded auth config for the given registry loaded from environment variables or docker config as available in that order
func EncodedConfigAuth ¶ added in v0.4.2
EncodedConfigAuth returns an encoded auth config for the given registry loaded from the docker config Returns an empty string if credentials cannot be found for the referenced server The docker config must be mounted on the container
func EncodedEnvAuth ¶ added in v0.4.2
EncodedEnvAuth returns an encoded auth config for the given registry loaded from environment variables Returns an error if authentication environment variables have not been set
func ExtractImageAndTag ¶ added in v0.4.2
ExtractImageAndTag from a concatenated string
func GetArchitectures ¶ added in v0.4.3
func GetAuthURL ¶ added in v0.4.2
GetAuthURL from the instructions in the challenge
func GetBearerHeader ¶ added in v0.4.2
GetBearerHeader tries to fetch a bearer token from the registry based on the challenge instructions
func GetChallenge ¶ added in v0.4.2
GetChallenge fetches a challenge for the registry hosting the provided image
func GetChallengeRequest ¶ added in v0.4.2
GetChallengeRequest creates a request for getting challenge instructions
func GetChallengeURL ¶ added in v0.4.2
GetChallengeURL creates a URL object based on the image info
func GetDigest ¶ added in v0.4.2
GetDigest from registry using a HEAD request to prevent rate limiting
func GetManifest ¶ added in v0.4.2
func GetPullOptions ¶ added in v0.4.2
func GetPullOptions(imageName string) (types.ImagePullOptions, error)
GetPullOptions creates a struct with all options needed for pulling images from a registry
func GetScopeFromImageName ¶ added in v0.4.2
GetScopeFromImageName normalizes an image name for use as scope during auth and head requests
func HasNewImage ¶ added in v0.4.2
func ImageName ¶ added in v0.4.2
func ImageName(containerInfo *types.ContainerJSON) string
func IsDaemonRunning ¶ added in v0.4.2
func IsDaemonRunning() bool
func NormalizeRegistry ¶ added in v0.4.2
NormalizeRegistry makes sure variations of DockerHubs registry
func ParseServerAddress ¶ added in v0.4.2
ParseServerAddress extracts the server part from a container image ref
func RenameContainer ¶ added in v0.4.2
func TransformAuth ¶ added in v0.4.2
TransformAuth from a base64 encoded json object to base64 encoded string
func WaitContainer ¶ added in v0.4.2
Types ¶
type RegistryCredentials ¶ added in v0.4.2
type RegistryCredentials struct { Username string Password string // usually a token rather than an actual password }
RegistryCredentials is a credential pair used for basic auth
type TokenResponse ¶ added in v0.4.2
type TokenResponse struct {
Token string `json:"token"`
}