make: add docker-dev-* targets for building dev images#10912
make: add docker-dev-* targets for building dev images#10912ZZiigguurraatt wants to merge 1 commit into
Conversation
Summary of ChangesHello, 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 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 AssistThe 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
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 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
|
13e4b8c to
e04ff7e
Compare
There was a problem hiding this comment.
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.
| # 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__') |
There was a problem hiding this comment.
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")
There was a problem hiding this comment.
do we care about this since we already have git used by another of other things in the makefile without this safeguard?
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.
e04ff7e to
50c5702
Compare
|
|
||
| # 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 |
There was a problem hiding this comment.
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.
|
@ZZiigguurraatt, remember to re-request review from reviewers when ready |
Adds three make targets that wrap dev.Dockerfile:
All three targets go through
docker buildx buildso the BuildKit cache mounts added in 20e6518 are used.This change helps development testing in a containerized network environment.