@Nullable
  private ImmutableList<String> computeProgramArguments(
      Image baseImage, ContainerConfiguration containerConfiguration) {
    boolean shouldInherit =
        baseImage.getProgramArguments() != null
            // Inherit CMD only when inheriting ENTRYPOINT.
            && containerConfiguration.getEntrypoint() == null
            && containerConfiguration.getProgramArguments() == null;

    ImmutableList<String> programArgumentsToUse =
        shouldInherit
            ? baseImage.getProgramArguments()
            : containerConfiguration.getProgramArguments();

    if (programArgumentsToUse != null) {
      String logSuffix = shouldInherit ? " (inherited from base image)" : "";
      String message = "Container program arguments set to " + programArgumentsToUse + logSuffix;
      buildContext.getEventHandlers().dispatch(LogEvent.lifecycle(message));
    }

    return programArgumentsToUse;
  }
Computes the image program arguments. If {@link ContainerConfiguration#getEntrypoint()} and
{@link ContainerConfiguration#getProgramArguments()} are null, the program arguments are
inherited from the base image. Otherwise {@link ContainerConfiguration#getProgramArguments()}
is returned.

@param baseImage the base image
@param containerConfiguration the container configuration
@return the container program arguments
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/BuildImageStep.java