Skip to content

BIRD: Add multi-stage Dockerfile to build latest v2.19.1 from source#3470

Merged
ipspace merged 12 commits into
ipspace:devfrom
jbemmel:bird-dockerfile-v2-from-src
Jun 13, 2026
Merged

BIRD: Add multi-stage Dockerfile to build latest v2.19.1 from source#3470
ipspace merged 12 commits into
ipspace:devfrom
jbemmel:bird-dockerfile-v2-from-src

Conversation

@jbemmel

@jbemmel jbemmel commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Provides a slim runtime image with BuildKit apt caching and parallel compilation for faster rebuilds.

Build: netlab clab build bird.v2_from_src with optional --sw-version

Use: netlab up -d bird -p clab 01-interfaces.yml -s nodes.dut.box=netlab/bird.v2_from_src:latest

Builds Bird v2.19.1 released on June 9th 2026, which reportedly supports

  • BGP: Automatic peering based on discovered neighbors
  • BGP/MPLS Ethernet VPNs using VXLAN tunnels

Now using a .j2 Dockerfile template to render user requested version

jbemmel added a commit to jbemmel/netlab that referenced this pull request Jun 12, 2026
Update BGP platform table, developer feature notes, and BIRD caveats
to reflect automatic LLA peering (BIRD 2.19+, PR ipspace#3470 image).

Co-authored-by: Cursor <cursoragent@cursor.com>

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job. However, please try to figure out how to set the BIRD version via an environment variable or some such, and document how to build various versions of the BIRD container, including building from source. Best place would be labs/bird.md, linked from labs/clab.md.

Also, it would be nice to set the container label to the actual software version when building from source.

&& rm -rf /var/lib/apt/lists/*

# Set BIRD version, 2.19.1 was released on 2026-06-09
ENV BIRD_VERSION=2.19.1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why would it be a good idea to hardcode a software version into a build file?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a first draft to get the idea across. I considered making the version configurable, but chose not to go there until asked. I'll make the changes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the default version to clab.sw_version (could use clab.build.sw_version if preferred)

User can override using --sw-version CLI param (but only for targets where clab.sw_version is defined)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why would it be a good idea to hardcode a software version into a build file?

See also

FROM quay.io/netscaler/netscaler-cpx:13.1-60.29

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, now we have a mechanism to fix that ;)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the default version to clab.sw_version (could use clab.build.sw_version if preferred)

I think we should go with clab.build.sw_version. No worries, I can fix that.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should go with clab.build.sw_version. No worries, I can fix that.

And of course I was wrong 🤷🏻‍♂️ Doing that would most probably trigger changes in clab.py code (where it displays how to build the container). I'll leave it as-is.

Comment thread netsim/daemons/bird/Dockerfile.v2_from_src.j2 Outdated
@jbemmel

jbemmel commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

Also, it would be nice to set the container label to the actual software version when building from source.

My thoughts exactly, but again a bigger change. I'll make the adjustments

@jbemmel jbemmel marked this pull request as draft June 12, 2026 20:53
jbemmel and others added 11 commits June 12, 2026 21:45
Provides a slim runtime image with BuildKit apt caching and parallel compilation for faster rebuilds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire clab.sw_version and sw_download_url into netlab clab build with pre-checks, versioned tags, and documentation for building different BIRD images.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace custom defaults scanning with merge_daemons and the existing devices API; minor build.py cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add get_default_tag helper and refresh the netlab clab build documentation table.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve the BIRD release in Dockerfile.v2_from_src.j2 instead of Docker build args, add a --sw-version CLI flag, fix .j2 Dockerfile discovery, and trim trailing whitespace via EditorConfig.

Co-authored-by: Cursor <cursoragent@cursor.com>
Version errors are detected during the Docker build, not in a pre-build check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse settings passed from clab run, gate --sw-version on clab.sw_version, and align user documentation with current tag and version behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove single-use helpers and read clab.sw_version directly from daemon defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
Catch template rendering errors specifically and read Dockerfiles as UTF-8.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jbemmel jbemmel force-pushed the bird-dockerfile-v2-from-src branch from 45f8855 to 54d48c1 Compare June 13, 2026 02:45
@jbemmel jbemmel marked this pull request as ready for review June 13, 2026 02:55

@ipspace ipspace left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, thank you!

@ipspace ipspace merged commit d6ecc5d into ipspace:dev Jun 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants