public Containerizer setOfflineMode(boolean offline) {
    if (mustBeOnline && offline) {
      throw new IllegalStateException("Cannot build to a container registry in offline mode");
    }
    this.offline = offline;
    return this;
  }
Sets whether or not to run the build in offline mode. In offline mode, the base image is
retrieved from the cache instead of pulled from a registry, and the build will fail if the base
image is not in the cache or if the target is an image registry.

@param offline if {@code true}, the build will run in offline mode
@return this
jib-core/src/main/java/com/google/cloud/tools/jib/api/Containerizer.java