Skip to content

Commit 29275a2

Browse files
docker: Fix missing CLN version in docker image
Changelog-Fixed: Core lightning version in Docker image will not be missing.
1 parent 882505d commit 29275a2

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

.dockerignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
Dockerfile
2-
contrib/docker/Dockerfile.*
3-
target
41
config.vars
2+
.cargo/
3+
.vscode/
4+
.venv/
5+
dist/
6+
target/
57
release/
6-
.venv/
8+
focal/
9+
jammy/
10+
noble/

.github/workflows/docker-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
uses: actions/checkout@v4
3737
with:
3838
ref: ${{ github.ref }} # Ensures the branch triggering the workflow is checked out
39+
fetch-depth: 0
3940

4041
- name: Set up QEMU
4142
uses: docker/setup-qemu-action@v3
@@ -116,3 +117,5 @@ jobs:
116117
push: true
117118
platforms: ${{ env.PLATFORMS }}
118119
tags: ${{ env.TAGS }}
120+
build-args: |
121+
VERSION=${{ env.VERSION }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ plugins/clnrest
8686
plugins/wss-proxy
8787
plugins/cln-bip353
8888
.clangd
89+
.cargo/
8990

9091
# Build directories
9192
bionic/

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ ARG LD=${target_arch}-ld
122122
ARG STRIP=${target_arch}-strip
123123
ARG TARGET=${target_arch_rust}
124124
ARG RUST_PROFILE=release
125+
ARG VERSION
126+
ENV VERSION=${VERSION}
125127

126128
#TODO: set all the following cargo config options via env variables (https://doc.rust-lang.org/cargo/reference/environment-variables.html)
127129
RUN mkdir -p .cargo && tee .cargo/config.toml <<EOF

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#! /usr/bin/make
22

3+
# Prefer VERSION from environment if provided (e.g., from GitHub Actions)
34
# Extract version from git, or if we're from a zipfile, use dirname
4-
VERSION=$(shell git describe --tags --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | $(SED) -n 's|.*/c\{0,1\}lightning-v\{0,1\}\([0-9a-f.rc\-]*\)$$|v\1|gp')
5+
VERSION ?= $(shell git describe --tags --always --dirty=-modded --abbrev=7 2>/dev/null || \
6+
pwd | sed -n 's|.*/c\{0,1\}lightning-v\{0,1\}\([0-9a-f.rc\-]*\)$$|v\1|gp')
7+
$(info Building version $(VERSION))
58

69
# Next release.
710
CLN_NEXT_VERSION := v25.12

0 commit comments

Comments
 (0)