jenkinsci / jenkinsci/docker-workflow-plugin

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

Open
#639 0 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

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.

---
Originally reported by iyzsong, imported from: Get published host port from the container within the inside block


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

Raw content of original issue

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.