Day 20. Hashicorp Nomad: Docker driver image behavior

Hashicorp Nomad: Docker driver image behavior

在Hashicorp forum看到这篇文章很有趣 Nomadproject.io missing documentation about Docker driver image behavior

内容

有使用者发现Nomad文件并未对nomad pull image,是先检查本地还是先从docker hub拉取有说明,所以看能不能在文件上说明,然後找出code, 说明Nomad在 image tag 是有特别处理的,後来Nomad文件也补上说明。

. image - The Docker image to run. The image may include a tag or custom URL and should include https:// if required. By default it will be fetched from Docker Hub. If the tag is omitted or equal to latest the driver will always try to pull the image. If the image to be pulled exists in a registry that requires authentication credentials must be provided to Nomad. Please see the Authentication section.

// loading it from the file system
func (d *Driver) createImage(task *drivers.TaskConfig, driverConfig *TaskConfig, client *docker.Client) (string, error) {
	image := driverConfig.Image
	repo, tag := parseDockerImage(image)

          
	// We're going to check whether the image is already downloaded. If the tag
	// is "latest", or ForcePull is set, we have to check for a new version every time so we don't
	// bother to check and cache the id here. We'll download first, then cache.
	if driverConfig.ForcePull {
		d.logger.Debug("force pulling image instead of inspecting local", "image_ref", dockerImageRef(repo, tag))
	} else if tag != "latest" {
		if dockerImage, _ := client.InspectImage(image); dockerImage != nil {
			// Image exists so just increment its reference count
			d.coordinator.IncrementImageReference(dockerImage.ID, image, task.ID)
			return dockerImage.ID, nil
		}
	}

          
	// Load the image if specified
	if driverConfig.LoadImage != "" {
		return d.loadImage(task, driverConfig, client)

<<:  #20 JS: Object Fundamentals

>>:  06 APCS 考试内容 Overview

Day17-选取器_单选+多选

暂时没有什麽小物件的想法 今天写一个简单的多选+一键取消的超简单选取器 首先先写HTML <f...

Day26 胖子变瘦子

胖子变瘦子 教学原文参考:胖子变瘦子 这篇文章会介绍使用 GIMP 的扭曲变换工具,将胖胖的人物,修...

排线相机 (续)

上次我们最後提到一些例子 -sh sharpness -100~100 -br brightness...

Day-12 於新电视上再次闪耀的那颗 SEGA 土星

这是一部由 SEGA 出品的第六代主机、故以太阳系中对应的第六颗行星 Saturn 为名、以下就简称...

Day 25-reverse terraform: terraformer,从 infrastructure 产生 .tf 内容

本篇介绍 terraformer,除了 import 既有的 remote resource 到 t...