module DockerClient
Defined in:
modules/docker_client/constants.crmodules/docker_client/docker_client.cr
Constant Summary
-
BASE_CONFIG =
"./config.yml"
-
DEFAULT_LOCAL_BINARY_PATH =
"tools/git/linux-amd64/docker"
Class Method Summary
- .cp(copy)
- .exec(command)
- .named_sha_list(resp_json)
-
.parse_image(fqdn_image_text : String)
############################################# All docker images can have one, two, three, or more segments.
- .pull(image)
- .save(image, output_file)
- .version_info
Class Method Detail
############################################# All docker images can have one, two, three, or more segments. The docker images that have multiple segments are separated by a slash.
** Multiple segments ** (Fully qualified) registry name with optional port /Org/image combination Multiple segment examples: e.g. docker.io/coredns/coredns mydockerregistry.io:8080/coredns/coredns, mydockerregistry.io:8080/coredns/coredns:latest, mydockerregistry.io:8080/privatecordnsorg/coredns/coredns:latest
Two segment examples: coredns/coredns, docker.io/busybox, myhostname:5000/myimagename:mytag
1) If the first segment has a period . in it, then the segment is a
fully qualified domain name.
2) If the first segment has colon in it : everything after the colon
is a port number a) If there are three or more segments, all segments (the middle segments) from the first and before the last are org names
- If the first segment is not a fully qualified domain name a) if there are two elements, the first element is an org b) If there are three or more segments, all segments excluding the last are org names
** The last segment (or one segment) ** Official docker image string e.g. busybox
4.a) If the docker image is only one segment,docker.io is used for the
registry, the whole segment is used image name, and if there is no
tag, latest
is used as the tag
4.b) Everything in the one segment (or the last segment if there are multiple segments) is an image or image:tag combination.
DockerClient.parse_image("mydockerregistry.io:8080/coredns/coredns:latest")
# => {"org_image" => "coredns/corends:latest", "org" => "coredns",
# "image" => "coredns:latest", "registry" => "mydockerregistry.io:8080", "tag" => "latest"}