<pre>
URI to the hosted container image in a Docker repository. The URI must be
fully qualified and include a tag or digest.
Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image&#64;digest"
</pre>

<code>string image = 1;</code>
160712
public java.lang.String getImage() {
    java.lang.Object ref = image_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      image_ = s;
      return s;
    }
  }
784476
public String content() throws IllegalArgumentException {

        StringBuilder b = new StringBuilder();

        DockerFileKeyword.FROM.addTo(b, baseImage != null ? baseImage : DockerAssemblyManager.DEFAULT_DATA_BASE_IMAGE);
        if (maintainer != null) {
            DockerFileKeyword.MAINTAINER.addTo(b, maintainer);
        }

        addOptimisation();
        addEnv(b);
        addLabels(b);
        addPorts(b);

        addCopy(b);
        addWorkdir(b);
        addShell(b);
        addRun(b);
        addVolumes(b);

        addHealthCheck(b);

        addCmd(b);
        addEntryPoint(b);

        addUser(b);

        return b.toString();
    }
154369
function digestFromManifestStr(manifestStr) {
    assert.string(manifestStr, 'manifestStr');

    var hash = crypto.createHash('sha256');
    var digestPrefix = 'sha256:';

    var manifest;
    try {
        manifest = JSON.parse(manifestStr);
    } catch (err) {
        throw new restifyErrors.InvalidContentError(err, fmt(
            'could not parse manifest: %s', manifestStr));
    }
    if (manifest.schemaVersion === 1) {
        try {
            var manifestBuffer = Buffer(manifestStr);
            var jws = _jwsFromManifest(manifest, manifestBuffer);
            hash.update(jws.payload, 'binary');
            return digestPrefix + hash.digest('hex');
        } catch (verifyErr) {
            if (!(verifyErr instanceof restifyErrors.InvalidContentError)) {
                throw verifyErr;
            }
            // Couldn't parse (or doesn't have) the signatures section,
            // fall through.
        }
    }
    hash.update(manifestStr);
    return digestPrefix + hash.digest('hex');
}
148002
def image_id_from_registry(image_name):
    """"""
    registry, repository, tag = parse(image_name)
    try:
        token = auth_token(registry, repository).get("token")
        # dockerhub is crazy
        if registry == "index.docker.io":
            registry = "registry-1.docker.io"
        res = requests.head("https://{}/v2/{}/manifests/{}".format(registry, repository, tag), headers={
            "Authorization": "Bearer {}".format(token),
            "Accept": "application/vnd.docker.distribution.manifest.v2+json"
        }, timeout=5)
        res.raise_for_status()
    except requests.RequestException:
        log.error("Received {} when attempting to get digest for {}".format(
            res, image_name))
        return None
    return "@".join([registry+"/"+repository, res.headers["Docker-Content-Digest"]])
866722
private URI getOriginalUri(HttpServletRequest request) {
    String requestUrl = request.getRequestURL().toString();
    String incomingScheme = URI.create(requestUrl).getScheme();
    String originalScheme = request.getHeader("X-Forwarded-Proto");
    if (originalScheme != null && !incomingScheme.equals(originalScheme)) {
      return URI.create(requestUrl.replaceFirst("^" + incomingScheme, originalScheme));
    } else {
      return URI.create(requestUrl);
    }
  }
806883
private boolean isImagePullRequired(AbstractRemoteDockerImage image) {
        boolean isAllNamesRequired = isAllNamesRequired();
        boolean isAllTagsRequired  = isAllTagsRequired();
        boolean isAllDigestsRequired = isAllDigestsRequired();

        // All images are required ?
        boolean forcePulling = config.isForcePull();
        // We want to pull everything - so every image is required
        if (isAllNamesRequired && isAllTagsRequired && isAllDigestsRequired && forcePulling) {
            return true;
        }

        // Otherwise we check if the image data is full for specific tag(s)/sha256
        if (!isImageDataValid(image)) {
            return false;
        }

        // Data from the remote image
        List<String> imageTags = image.getImageTags();
        String imageDigest = image.getImageDigest();
        String imageName = image.getRepositoryName();

        if (imageTags == null || imageTags.isEmpty()) {
            logger.info("Image {} with Digest {} - does not have any tags and will be ignored", imageName, imageDigest);
            return false;
        }

        // Data from the config file
        List<String> configImageNames = config.getImageNames();
        List<String> configImageTags = config.getImageTags();
        List<String> configImageDigests = config.getImageDigests();

        boolean isNameMet;
        // Empty configuration = similar to using all names
        if (configImageNames == null) {
            isNameMet = true;
            logger.debug("Configuration - docker.pull.images was not found - using .*.* as default");
        }
        // 'Name' may have a regular expression match
        else {
            isNameMet = isAllNamesRequired || configImageNames.contains(imageName) || isMatchStringInList(imageName, configImageNames);
        }

        // 'Tag' may have a regular expression match
        // 'Tag' should consider pulling/ignoring images with the WS.Scanned tag - according to 'docker.pull.force' flag
        boolean isTagMet = false;
        if (configImageTags == null) {
            isTagMet = true;
            logger.debug("Configuration - docker.pull.tags was not found - using .*.* as default");
        }else {
            for(String currentTag : imageTags) {
                isTagMet = isTagMet || configImageTags.contains(currentTag) || isMatchStringInList(currentTag, configImageTags);
            }
        }

        // 'Digest' cannot have a regular expression match
        boolean isDigestMet = isAllDigestsRequired || configImageDigests.contains(imageDigest);

        // Do not pull images that are already tagged with WS.Scanned tag
        if (!forcePulling) {
            if (imageTags.contains(WS_SCANNED_TAG)) {
                logger.debug("Image {} - was scanned already", imageName);
                isTagMet = false;
            }
        }

        // Is this tag/sha256/name in the required tags/sha256/name list?
        boolean result = isNameMet && isTagMet && isDigestMet ;
        if (!result) {
            logger.debug("Image does not met the requirements: {}", image);
            logger.debug("Name met - {} , Tag met - {} , Digest met - {}", isNameMet, isTagMet, isDigestMet);
        }
        return result;
    }
85888
private String urlEncode(final String unencoded) throws DockerException {
    try {
      final String encode = URLEncoder.encode(unencoded, UTF_8.name());
      return encode.replaceAll("\\+", "%20");
    } catch (UnsupportedEncodingException e) {
      throw new DockerException(e);
    }
  }
958187
protected URI createUri(String file,
      DatanodeID[] candidates,  UnixUserGroupInformation ugi,
      HttpServletRequest request) throws URISyntaxException {
    String scheme = request.getScheme();
    final DatanodeID host = candidates[0];
    final String hostname;
    if (host instanceof DatanodeInfo) {
      hostname = ((DatanodeInfo)host).getHostName();
    } else {
      hostname = host.getHost();
    }
    
    // Construct query.
    StringBuilder builder = new StringBuilder();
    builder.append("ugi=" + ugi);
    
    // Populate the rest of parameters.
    Enumeration<?> it = request.getParameterNames();
    while (it.hasMoreElements()) {
      String key = it.nextElement().toString();
      String value = request.getParameter(key);
      builder.append("&" + key + "=" + value);
    }

    // Construct the possible candidates for retry
    if (candidates.length > 1) {
      builder.append("&candidates=");
      appendDatanodeID(builder, candidates[1]);
      for (int j=2; j<candidates.length; j++) {
        builder.append(" ");
        appendDatanodeID(builder, candidates[j]);
      }
    }

    // Add namenode address to the url params
    NameNode nn = (NameNode)getServletContext().getAttribute("name.node");
    String addr = NetUtils.toIpPort(nn.getNameNodeAddress());
    builder.append(JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr));

    return new URI(scheme, null, hostname,
        "https".equals(scheme)
          ? (Integer)getServletContext().getAttribute("datanode.https.port")
          : host.getInfoPort(),
        "/streamFile" + file, builder.toString(), null);
  }
422072
function(tag, confImage, callback) {

      grunt.log.subhead(actioning[action] + ' image [' + tag + ']');

      async.waterfall([

      // Step 1: search for a running container with the same image
      function(cb) {
        docker.listContainers({
          all : 1,
        // filters: (action !== 'unpause') ? '{"status":["running"]}' : null
        }, function(err, containers) {

          if (err) {
            return cb(err);
          }

          var container = null;

          for (var c = 0; c < containers.length; c++) {
            if (containers[c].Image.indexOf(utils.qualifiedImageName(tag,
                  options.registry, null)) === 0) {
              container = containers[c];
              break;
            }
          }

          cb(null, container);
        });
      },

      // Step 2: stop it
      function(container, cb) {
        if (container) {
          grunt.log.writeln("Found a matched container, " + action + " it.");

          var dockcontainer = docker.getContainer(container.Id);

          var opts = confImage.options && confImage.options[action] || {};
          dockcontainer[action](opts, function(e, stream) {
            if (stream && stream.readable) {
              stream.setEncoding('utf8');
              stream.on('error', cb);
              stream.on('end', cb);
              stream.on('data', grunt.log.write);
            } else {
              cb(e);
            }

          });
        } else {
          grunt.log.writeln("No matched container with this image.");
          cb(null);
        }
      }, ], callback);

    }
1064555
def commit_container(self, container_id, image=None, message=None):
        
        logger.info("committing container '%s'", container_id)
        logger.debug("container_id = '%s', image = '%s', message = '%s'",
                     container_id, image, message)
        tag = None
        if image:
            tag = image.tag
            image = image.to_str(tag=False)
        response = self.d.commit(container_id, repository=image, tag=tag, message=message)
        logger.debug("response = '%s'", response)
        try:
            return response['Id']
        except KeyError:
            logger.error("ID missing from commit response")
            raise RuntimeError("ID missing from commit response")
691574
def getImage(path, dockerfile, tag):
    '''
    '''
    image = getImageByTag(tag)

    if not image:
        # Build an Image using the dockerfile in the path
        try:
            image = client.images.build(
              path=path,
              dockerfile=dockerfile,
              tag=tag
            )
        except BuildError as exc:
            eprint("Failed to build docker image")
            raise exc
        except TypeError as exc:
            eprint("You must give a path to the build environemnt.")
            raise exc
        except APIError as exc:
            eprint("Unhandled error while building image", tag)
            raise exc

    return image
1211430
URI generateUrl(InitializrServiceMetadata metadata) {
		try {
			URIBuilder builder = new URIBuilder(this.serviceUrl);
			StringBuilder sb = new StringBuilder();
			if (builder.getPath() != null) {
				sb.append(builder.getPath());
			}

			ProjectType projectType = determineProjectType(metadata);
			this.type = projectType.getId();
			sb.append(projectType.getAction());
			builder.setPath(sb.toString());

			if (!this.dependencies.isEmpty()) {
				builder.setParameter("dependencies",
						StringUtils.collectionToCommaDelimitedString(this.dependencies));
			}

			if (this.groupId != null) {
				builder.setParameter("groupId", this.groupId);
			}
			String resolvedArtifactId = resolveArtifactId();
			if (resolvedArtifactId != null) {
				builder.setParameter("artifactId", resolvedArtifactId);
			}
			if (this.version != null) {
				builder.setParameter("version", this.version);
			}
			if (this.name != null) {
				builder.setParameter("name", this.name);
			}
			if (this.description != null) {
				builder.setParameter("description", this.description);
			}
			if (this.packageName != null) {
				builder.setParameter("packageName", this.packageName);
			}
			if (this.type != null) {
				builder.setParameter("type", projectType.getId());
			}
			if (this.packaging != null) {
				builder.setParameter("packaging", this.packaging);
			}
			if (this.javaVersion != null) {
				builder.setParameter("javaVersion", this.javaVersion);
			}
			if (this.language != null) {
				builder.setParameter("language", this.language);
			}
			if (this.bootVersion != null) {
				builder.setParameter("bootVersion", this.bootVersion);
			}

			return builder.build();
		}
		catch (URISyntaxException ex) {
			throw new ReportableException(
					"Invalid service URL (" + ex.getMessage() + ")");
		}
	}
726576
public static void pullImage(String imageTag, String username, String password, String host) throws IOException {
        final AuthConfig authConfig = new AuthConfig();
        authConfig.withUsername(username);
        authConfig.withPassword(password);

        DockerClient dockerClient = null;
        try {
            dockerClient = getDockerClient(host);
            dockerClient.pullImageCmd(imageTag).withAuthConfig(authConfig).exec(new PullImageResultCallback()).awaitSuccess();
        } finally {
            closeQuietly(dockerClient);
        }
    }
429103
function parseGitUrl(giturl) {
    var ref, uri, fileParts, filepath;

    if (!checkGitUrl(giturl)) return null;
    giturl = giturl.slice(GIT_PREFIX.length);

    uri = new URI(giturl);
    ref = uri.fragment() || 'master';
    uri.fragment(null);

    // Extract file inside the repo (after the .git)
    fileParts =uri.path().split('.git');
    filepath = fileParts.length > 1? fileParts.slice(1).join('.git') : '';
    if (filepath[0] == '/') filepath = filepath.slice(1);

    // Recreate pathname without the real filename
    uri.path(_.first(fileParts)+'.git');

    return {
        host: uri.toString(),
        ref: ref || 'master',
        filepath: filepath
    };
}
159285
@Nullable public de.uniulm.omi.cloudiator.flexiant.client.domain.Image getImage(
        final String imageUUID) throws FlexiantException {
        final io.github.cloudiator.flexiant.extility.Image image =
            this.getResource(imageUUID, ResourceType.IMAGE,
                io.github.cloudiator.flexiant.extility.Image.class);
        if (image == null) {
            return null;
        }
        return new de.uniulm.omi.cloudiator.flexiant.client.domain.Image(image);
    }
887118
private static String massageURI(String uri) {
    uri = uri.trim();
    int protocolEnd = uri.indexOf(':');
    if (protocolEnd < 0 || isColonFollowedByPortNumber(uri, protocolEnd)) {
      // No protocol, or found a colon, but it looks like it is after the host, so the protocol is still missing,
      // so assume http
      uri = "http://" + uri;
    }
    return uri;
  }
266889
@Override
    URI getURI() {
        try {
            return new URI(URLPathEncoder.normalizeURLPath(getZipFilePath()));
        } catch (final URISyntaxException e) {
            throw new IllegalArgumentException("Could not form URI: " + e);
        }
    }