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;
  }
@Test
  public void testGetContainerConfiguration()
      throws IOException, URISyntaxException, DigestException {
    setUp(V22ManifestTemplate.class);

    // Loads the expected JSON string.
    Path jsonFile = Paths.get(Resources.getResource("core/json/containerconfig.json").toURI());
    String expectedJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);

    // Translates the image to the container configuration and writes the JSON string.
    JsonTemplate containerConfiguration = imageToJsonTranslator.getContainerConfiguration();

    Assert.assertEquals(expectedJson, JsonTemplateMapper.toUtf8String(containerConfiguration));
  }