public Builder setExposedPorts(@Nullable Set<Port> exposedPorts) {
      if (exposedPorts == null) {
        this.exposedPorts = null;
      } else {
        Preconditions.checkArgument(
            exposedPorts.stream().allMatch(Objects::nonNull), "ports list contains null elements");
        this.exposedPorts = new HashSet<>(exposedPorts);
      }
      return this;
    }
Sets the container's exposed ports.

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