Skip to content

make: add docker-dev-* targets for building dev images#10912

Open
ZZiigguurraatt wants to merge 1 commit into
lightningnetwork:masterfrom
ZZiigguurraatt:make_dev_Dockerfile
Open

make: add docker-dev-* targets for building dev images#10912
ZZiigguurraatt wants to merge 1 commit into
lightningnetwork:masterfrom
ZZiigguurraatt:make_dev_Dockerfile

Conversation

@ZZiigguurraatt

Copy link
Copy Markdown
Contributor

Adds three make targets that wrap dev.Dockerfile:

  • docker-dev-build builds an lnd dev image, tagged $(DOCKER_DEV_IMAGE) (default lnd-dev:).
  • docker-dev-lndinit-build layers an lndinit image on top, tagged $(LNDINIT_REPO):lnd-dev- (default lndinit:...).
  • docker-dev-lndinit-build-push builds and pushes the lndinit image.

All three targets go through docker buildx build so the BuildKit cache mounts added in 20e6518 are used.

This change helps development testing in a containerized network environment.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a set of Makefile targets to simplify the process of building and managing development-specific docker images. By wrapping 'docker buildx build', these changes improve the developer experience in containerized environments while ensuring efficient use of BuildKit cache mounts.

Highlights

  • New Makefile Targets: Added three new targets: docker-dev-build, docker-dev-lndinit-build, and docker-dev-lndinit-build-push to streamline the creation of development docker images.
  • BuildKit Integration: Configured the new targets to utilize 'docker buildx build', ensuring compatibility with BuildKit cache mounts for faster builds.
  • Documentation Updates: Updated docs/DOCKER.md and the release notes to reflect the new workflow and provide usage examples for the new targets.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the severity-low Best-effort review label Jun 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new Makefile targets (docker-dev-build, docker-dev-lndinit-build, and docker-dev-lndinit-build-push) to streamline building and pushing development Docker images for lnd and lndinit using BuildKit, alongside updating the corresponding documentation and release notes. The review feedback highlights two important issues in the Makefile: first, the shell parameter expansion for parsing DOCKER_DEV_IMAGE fails when the image name contains a registry port or lacks a tag; second, running the build outside of a git repository causes git describe to fail, leading to an invalid empty tag. Both comments provide robust shell script suggestions to handle these edge cases.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Makefile
Comment thread Makefile
# like `kvdb/v1.5.1` — `/` is not a valid character in a docker image tag.
# `--match='__no_such_tag__'` forces `git describe` to ignore all tags so
# `--always` falls back to the short hash.
DOCKER_DEV_COMMIT := $(shell git describe --always --dirty --match='__no_such_tag__')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If make is run outside of a git repository (e.g., from a source archive or in a bare container), git describe will fail and print an error to stderr, resulting in an empty DOCKER_DEV_COMMIT. This causes DOCKER_DEV_IMAGE to be tagged as lnd-dev:, which is an invalid Docker tag. Adding a fallback to latest and redirecting stderr to /dev/null makes the build more robust in non-git environments.

DOCKER_DEV_COMMIT := $(shell git describe --always --dirty --match='__no_such_tag__' 2>/dev/null || echo "latest")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do we care about this since we already have git used by another of other things in the makefile without this safeguard?

@github-actions github-actions Bot added severity-low Best-effort review and removed severity-low Best-effort review labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown

PR Severity: LOW - Automated classification | 3 files | 110 lines changed. Files: Makefile (build tooling), docs/DOCKER.md (documentation), docs/release-notes/release-notes-0.22.0.md (release notes). All LOW severity. No bumps (3 files, 110 lines). <!-- pr-severity-bot -->

Adds three make targets that wrap dev.Dockerfile:

- docker-dev-build builds an lnd dev image, tagged $(DOCKER_DEV_IMAGE)
(default lnd-dev:<short-hash>).
- docker-dev-lndinit-build layers an lndinit image on top, tagged
$(LNDINIT_REPO):lnd-dev-<short-hash> (default lndinit:...).
- docker-dev-lndinit-build-push builds and pushes the lndinit image.

All three targets go through `docker buildx build` so the BuildKit
cache mounts added in 20e6518 are used.
Comment thread Makefile

# Build context (path or git URL with optional #ref) for lndinit's dev.Dockerfile.
# NOTE: `#` is escaped as `\#` so make doesn't treat the ref as a comment.
LNDINIT_CONTEXT ?= https://github.com/lightninglabs/lndinit.git\#main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do we want to set this to a release instead of tracking the default branch?

cons are we would have to remember to update here when we have new lndinit releases.

@saubyk saubyk added this to lnd v0.22 Jun 25, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in lnd v0.22 Jun 25, 2026
@saubyk saubyk moved this from Backlog to In review in lnd v0.22 Jun 25, 2026
@lightninglabs-deploy

Copy link
Copy Markdown
Collaborator

@ZZiigguurraatt, remember to re-request review from reviewers when ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-low Best-effort review

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants