Class PortBindingParser

java.lang.Object
org.jenkinsci.plugins.dockerbuildstep.util.PortBindingParser

public class PortBindingParser extends Object
Parser for port mapping definitions that define how exposed container ports are mapped to host ports of the Docker server.
  • Constructor Details

    • PortBindingParser

      public PortBindingParser()
  • Method Details

    • parse

      public static com.github.dockerjava.api.model.PortBinding[] parse(String definition) throws IllegalArgumentException
      Parses a textual port binding definition to an array of PortBindings. Assumes one port binding per line in format
      • hostPort containerPort
      • hostPort containerPort/protocol
      • hostIP:hostPort containerPort
      • hostIP:hostPort containerPort/protocol
      where host and container part can alternatively be delimited by a colon.
      Throws:
      IllegalArgumentException - if any error occurs during parsing