jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-49567] Automatically support docker networks in pipelines with multiple containers

Open
#558 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

As is, it's not possible to create a Jenkinsfile with docker containers that need to communicate with each other (and not just a basic connection from container A to container B). For example, when running Behat tests for Drupal:

  • The webapp container (with PHP etc) çontains Behat, which needs to be able to link to the Selenium container.
  • The Selenium container needs to be able to link back to the webapp container to load pages.

This leads to a chicken-and-the-egg problem, since you can't know the ID of a container before it starts. I imagine there's a way to hack it with container names, but that seems collision prone.

Under other tools like Circle CI, a docker network is transparently created and all containers ports from their Dockerfiles are automatically exposed to each other. For example, even though there are two containers, from both perspectives all ports are available on localhost.

On top of this, the recommended --link parameter has been deprecated by docker, so moving to bridge networks will keep the plugin working with future Docker releases.


Originally reported by deviantintegral, imported from: Automatically support docker networks in pipelines with multiple containers
  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 4
  • watchers: 10
  • imported: 2025-12-07
Raw content of original issue

As is, it's not possible to create a Jenkinsfile with docker containers that need to communicate with each other (and not just a basic connection from container A to container B). For example, when running Behat tests for Drupal:

  • The webapp container (with PHP etc) çontains Behat, which needs to be able to link to the Selenium container.
  • The Selenium container needs to be able to link back to the webapp container to load pages.

This leads to a chicken-and-the-egg problem, since you can't know the ID of a container before it starts. I imagine there's a way to hack it with container names, but that seems collision prone.

Under other tools like Circle CI, a docker network is transparently created and all containers ports from their Dockerfiles are automatically exposed to each other. For example, even though there are two containers, from both perspectives all ports are available on localhost.

On top of this, the recommended --link parameter has been deprecated by docker, so moving to bridge networks will keep the plugin working with future Docker releases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points; begin by locating the docker-workflow-plugin code responsible for running multiple containers and its current --link handling. Review how pipeline container lifecycles are managed before considering the requested bridge-network behavior. Done means mutually reachable containers with their Dockerfile ports available as described, while supporting current Docker releases.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.