Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60674

Get published host port from the container within the inside block

      Hello, is there a way to get the published host port of the container within the `inside` block?

      Like this:

        docker.build('test').inside('--publish 8080') { c ->
          echo c.port(8080)
        }
      

       Our tests run inside the container, and publish a port for external system to use.

          [JENKINS-60674] Get published host port from the container within the inside block

          Bunnbu Sou created issue -
          Bunnbu Sou made changes -
          Description Original: Hello, is there a way to get the published host port of the container within the `inside` block?

          Like this:
          ```
            docker.build('test').inside('--publish 8080') { c ->
              echo c.port(8080)
            }

          ```

           Our tests run inside the container, and publish a port for external system to use.
          New: Hello, is there a way to get the published host port of the container within the `inside` block?

          Like this:
          {code:java}
            docker.build('test').inside('--publish 8080') { c ->
              echo c.port(8080)
            }
          {code}

           Our tests run inside the container, and publish a port for external system to use.

            Unassigned Unassigned
            iyzsong Bunnbu Sou
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: