public static Containerizer to(RegistryImage registryImage) {
    ImageConfiguration imageConfiguration =
        ImageConfiguration.builder(registryImage.getImageReference())
            .setCredentialRetrievers(registryImage.getCredentialRetrievers())
            .build();

    Function<BuildContext, StepsRunner> stepsRunnerFactory =
        buildContext -> StepsRunner.begin(buildContext).registryPushSteps();

    return new Containerizer(
        DESCRIPTION_FOR_DOCKER_REGISTRY, imageConfiguration, stepsRunnerFactory, true);
  }
Gets a new {@link Containerizer} that containerizes to a container registry.

@param registryImage the {@link RegistryImage} that defines target container registry and
    credentials
@return a new {@link Containerizer}
jib-core/src/main/java/com/google/cloud/tools/jib/api/Containerizer.java