public Builder setLabels(@Nullable Map<String, String> labels) {
      if (labels == null) {
        this.labels = null;
      } else {
        Preconditions.checkArgument(
            !Iterables.any(labels.keySet(), Objects::isNull), "labels map contains null keys");
        Preconditions.checkArgument(
            !Iterables.any(labels.values(), Objects::isNull), "labels map contains null values");
        this.labels = new HashMap<>(labels);
      }
      return this;
    }
Sets the container's labels.

@param labels the map of labels
@return this
jib-core/src/main/java/com/google/cloud/tools/jib/configuration/ContainerConfiguration.java