Get image Id from imageTag using DockerBuildInfoHelper client.

@param imageTag
@param host
@return
772046
public static String getImageIdFromTag(String imageTag, String host) throws IOException {
        DockerClient dockerClient = null;
        try {
            dockerClient = getDockerClient(host);
            return dockerClient.inspectImageCmd(imageTag).exec().getId();
        } finally {
            closeQuietly(dockerClient);
        }
    }
369574
public void addTag(IccTag tag) {
    tags.add(tag);
    hashTagsId.put(tag.signature, tag);
    Tag t = TiffTags.getTag(tag.signature);
    if (t != null)
      hashTagsName.put(t.getName(), tag);
  }
117304
def image_id_from_k8s():
    """"""
    token_path = "/var/run/secrets/kubernetes.io/serviceaccount/token"
    if os.path.exists(token_path):
        k8s_server = "https://{}:{}/api/v1/namespaces/default/pods/{}".format(
            os.getenv("KUBERNETES_SERVICE_HOST"), os.getenv(
                "KUBERNETES_PORT_443_TCP_PORT"), os.getenv("HOSTNAME")
        )
        try:
            res = requests.get(k8s_server, verify="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",
                               timeout=3, headers={"Authorization": "Bearer {}".format(open(token_path).read())})
            res.raise_for_status()
        except requests.RequestException:
            return None
        try:
            return res.json()["status"]["containerStatuses"][0]["imageID"].strip("docker-pullable://")
        except (ValueError, KeyError, IndexError):
            logger.exception("Error checking kubernetes for image id")
            return None
375423
def find_container(host)
      id = host['docker_container_id']
      name = host['docker_container_name']
      return unless id || name

      containers = ::Docker::Container.all

      if id
        @logger.debug("Looking for an existing container with ID #{id}")
        container = containers.select { |c| c.id == id }.first
      end

      if name && container.nil?
        @logger.debug("Looking for an existing container with name #{name}")
        container = containers.select do |c|
          c.info['Names'].include? "/#{name}"
        end.first
      end

      return container unless container.nil?
      @logger.debug("Existing container not found")
    end
578118
public String getTag(final Method method) {
        final Annotation[] annotations = method.getAnnotations();
        return this.getTag(annotations, method);
    }
863683
public ResourceRequestInfo getPendingRequestOnHost(
    String host, ResourceType type) {
    Context c = getContext(type);
    List<ResourceRequestInfo> hostReqs = c.hostToPendingRequests.get(host);
    if (hostReqs != null) {
      // Returning the first element in the list makes the subsequent
      // call to Utilities.removeReference() very fast.
      return hostReqs.get(0);
    }
    return null;
  }
1266168
@Deprecated
  DatanodeDescriptor getDatanodeByHost(String host) {
    if (host==null) {
      return null;
    }
      
    hostmapLock.readLock().lock();
    try {
      DatanodeDescriptor[] nodes = map.get(host);
      // no entry
      if (nodes== null) {
        return null;
      }
      // one node
      if (nodes.length == 1) {
        return nodes[0];
      }
      // more than one node
      return nodes[r.nextInt(nodes.length)];
    } finally {
      hostmapLock.readLock().unlock();
    }
  }
125806
public static void pushImageTag(DockerClient docker, String imageName,
                                List<String> imageTags, Log log, boolean skipPush)
      throws MojoExecutionException, DockerException, IOException, InterruptedException {

    if (skipPush) {
      log.info("Skipping docker push");
      return;
    }
    // tags should not be empty if you have specified the option to push tags
    if (imageTags.isEmpty()) {
      throw new MojoExecutionException("You have used option \"pushImageTag\" but have"
                                       + " not specified an \"imageTag\" in your"
                                       + " docker-maven-client's plugin configuration");
    }
    final CompositeImageName compositeImageName = CompositeImageName.create(imageName, imageTags);
    for (final String imageTag : compositeImageName.getImageTags()) {
      final String imageNameWithTag = compositeImageName.getName() + ":" + imageTag;
      log.info("Pushing " + imageNameWithTag);
      docker.push(imageNameWithTag, new AnsiProgressHandler());
    }
  }
639176
public static boolean pullImage(Launcher launcher, final String imageTag, final String username, final String password, final String host)
            throws IOException, InterruptedException {

        return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, IOException>() {
            public Boolean call() throws IOException {
                DockerUtils.pullImage(imageTag, username, password, host);
                return true;
            }
        });
    }
1233695
private boolean isJawrImageTag(ComponentTag tag) {
		String tagName = tag.getName();
		return (tagName.equalsIgnoreCase("img") || (tagName
				.equalsIgnoreCase("input") && tag.getAttribute("type").equals(
				"image")));
	}
124203
async def tag(self, name: str, repo: str, *, tag: str = None) -> bool:
        
        params = {"repo": repo}

        if tag:
            params["tag"] = tag

        await self.docker._query(
            "images/{name}/tag".format(name=name),
            "POST",
            params=params,
            headers={"content-type": "application/json"},
        )
        return True
1000028
public int getIdByTag(String tag)
    {
        Integer value = (Integer) table.getValueByKey(tag);
        if (value == null)
            LoggerFactory.getDefaultLogger().error(
                "** " + this.getClass().getName() + ": Tag '" + tag + "' is not defined. **");
        return value.intValue();
    }
1116816
public static String queryIp(String host) {
		InetAddress[] addresses;
		try {
			addresses = InetAddress.getAllByName(host);
		}
		catch (UnknownHostException e) {
			return null;
		}
		// System.out.println("len:" + addresses.length);
		if (addresses.length == 1) {
			return addresses[0].getHostAddress();
		}
		else {
			// 多IP时，随机返回一个
			int random = new Random().nextInt(addresses.length);
			return addresses[random].getHostAddress();
		}
	}
925213
func imageIDFromTag(tag string) string {
	args := []string{"inspect", "--format={{.Id}}", tag}
	output, err := commandOutput("docker", args)
	if err != nil {
		return ""
	}
	return output
}
500469
def get_container_image_ids(self):
        

        statuses = graceful_chain_get(self.json, "status", "containerStatuses")
        if statuses is None:
            return {}

        def remove_prefix(image_id, prefix):
            if image_id.startswith(prefix):
                return image_id[len(prefix):]

            return image_id

        return {status['image']: remove_prefix(status['imageID'], 'docker://')
                for status in statuses}
898107
public RequestedNode resolve(String host, ResourceType type) {
    RunnableIndices indices = typeToIndices.get(type);
    return indices.getOrCreateRequestedNode(host);
  }
1074523
public synchronized void registerContainer(String containerId,
                                               ImageConfiguration imageConfig,
                                               GavLabel gavLabel) {
        ContainerShutdownDescriptor descriptor = new ContainerShutdownDescriptor(imageConfig, containerId);
        shutdownDescriptorPerContainerMap.put(containerId, descriptor);
        updatePomLabelMap(gavLabel, descriptor);
        updateImageToContainerMapping(imageConfig, containerId);
    }