code: public DockerCLI createCliForInspect(InspectContainerResponse inspect)
              throws IOException, InterruptedException {
          LOG.debug("Creating CLI for {}", inspect);
          Integer httpPort = null;
          // CLI mess around ports
          Integer cliPort = null; // should be this
          Integer jnlpAgentPort = null; // but in reality used this
  
          final Map<ExposedPort, Ports.Binding[]> bindings = inspect.getNetworkSettings().getPorts().getBindings();
          LOG.trace("Bindings: {}", bindings);
          for (Map.Entry<ExposedPort, Ports.Binding[]> entry : bindings.entrySet()) {
              if (entry.getKey().getPort() == JENKINS_DEFAULT.httpPort) {
                  httpPort = Integer.valueOf(entry.getValue()[0].getHostPortSpec());
              }
              if (entry.getKey().getPort() == JENKINS_DEFAULT.tcpPort) {
                  final Ports.Binding binding = entry.getValue()[0];
                  jnlpAgentPort = Integer.valueOf(binding.getHostPortSpec());
              }
              if (entry.getKey().getPort() == JENKINS_DEFAULT.jnlpPort) {
                  cliPort = Integer.valueOf(entry.getValue()[0].getHostPortSpec());
              }
          }
          LOG.trace("Creating URL {}", bindings);
          final URL url = new URL("http://" + getHost() + ":" + httpPort.toString());
          LOG.trace("Created URL {}", url.toExternalForm());
  
          if (isNull(jnlpAgentPort)) {
              throw new IOException("Can't get jnlpPort." + bindings.toString());
          }
          return createCliWithWait(url, jnlpAgentPort);
      }
docs: Return {@link CLI} for jenkins docker container.
  // TODO no way specify CliPort (hacky resolution {@link DockerCLI})