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 ¶
BuildManifestURL from raw image data
func CloneContainer ¶
func CompareDigest ¶
CompareDigest ...
func ConvertToHostname ¶
ConvertToHostname strips a url from everything but the hostname part
func CredentialsStore ¶
func CredentialsStore(configFile configfile.ConfigFile) credentials.Store
CredentialsStore returns a new credentials store based on the settings provided in the configuration file.
func CurrentArchitecture ¶
func EncodeAuth ¶
func EncodeAuth(authConfig types.AuthConfig) (string, error)
EncodeAuth Base64 encode an AuthConfig struct for transmission over HTTP
func EncodedAuth ¶
EncodedAuth returns an encoded auth config for the given registry loaded from environment variables or docker config as available in that order
func EncodedConfigAuth ¶
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 ¶
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 ¶
ExtractImageAndTag from a concatenated string
func GetAuthURL ¶
GetAuthURL from the instructions in the challenge
func GetBearerHeader ¶
GetBearerHeader tries to fetch a bearer token from the registry based on the challenge instructions
func GetChallenge ¶
GetChallenge fetches a challenge for the registry hosting the provided image
func GetChallengeRequest ¶
GetChallengeRequest creates a request for getting challenge instructions
func GetChallengeURL ¶
GetChallengeURL creates a URL object based on the image info
func GetManifest ¶
func GetPullOptions ¶
func GetPullOptions(imageName string) (types.ImagePullOptions, error)
GetPullOptions creates a struct with all options needed for pulling images from a registry
func GetScopeFromImageName ¶
GetScopeFromImageName normalizes an image name for use as scope during auth and head requests
func HasNewImage ¶
func ImageName ¶
func ImageName(containerInfo *types.ContainerJSON) string
func IsDaemonRunning ¶
func IsDaemonRunning() bool
func NormalizeRegistry ¶
NormalizeRegistry makes sure variations of DockerHubs registry
func ParseServerAddress ¶
ParseServerAddress extracts the server part from a container image ref
func TransformAuth ¶
TransformAuth from a base64 encoded json object to base64 encoded string
func WaitContainer ¶
Types ¶
type RegistryCredentials ¶
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 ¶
type TokenResponse struct {
Token string `json:"token"`
}