public JsonTemplate getContainerConfiguration() {
    // Set up the JSON template.
    ContainerConfigurationTemplate template = new ContainerConfigurationTemplate();

    // Adds the layer diff IDs.
    for (Layer layer : image.getLayers()) {
      template.addLayerDiffId(layer.getDiffId());
    }

    // Adds the history.
    for (HistoryEntry historyObject : image.getHistory()) {
      template.addHistoryEntry(historyObject);
    }

    template.setCreated(image.getCreated() == null ? null : image.getCreated().toString());
    template.setArchitecture(image.getArchitecture());
    template.setOs(image.getOs());
    template.setContainerEnvironment(environmentMapToList(image.getEnvironment()));
    template.setContainerEntrypoint(image.getEntrypoint());
    template.setContainerCmd(image.getProgramArguments());
    template.setContainerExposedPorts(portSetToMap(image.getExposedPorts()));
    template.setContainerVolumes(volumesSetToMap(image.getVolumes()));
    template.setContainerLabels(image.getLabels());
    template.setContainerWorkingDir(image.getWorkingDirectory());
    template.setContainerUser(image.getUser());

    // Ignore healthcheck if not Docker/command is empty
    DockerHealthCheck healthCheck = image.getHealthCheck();
    if (image.getImageFormat() == V22ManifestTemplate.class && healthCheck != null) {
      template.setContainerHealthCheckTest(healthCheck.getCommand());
      healthCheck
          .getInterval()
          .ifPresent(interval -> template.setContainerHealthCheckInterval(interval.toNanos()));
      healthCheck
          .getTimeout()
          .ifPresent(timeout -> template.setContainerHealthCheckTimeout(timeout.toNanos()));
      healthCheck
          .getStartPeriod()
          .ifPresent(
              startPeriod -> template.setContainerHealthCheckStartPeriod(startPeriod.toNanos()));
      template.setContainerHealthCheckRetries(healthCheck.getRetries().orElse(null));
    }

    return template;
  }
Gets the container configuration.

@return the container configuration
jib-core/src/main/java/com/google/cloud/tools/jib/image/json/ImageToJsonTranslator.java