From cc2078ccddd1bf77fbc225ae5507eea6c125b956 Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Wed, 14 Aug 2024 12:46:54 +0200 Subject: [PATCH] Makefile: Add EXTRA_VERSION Add this new make variable so users can specify build information without modifying the runc version nor the source code. Signed-off-by: Rodrigo Campos --- Makefile | 3 ++- README.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0fc9923e4f2..3c952faefcf 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ BUILDTAGS ?= seccomp urfave_cli_no_docs BUILDTAGS += $(EXTRA_BUILDTAGS) COMMIT ?= $(shell git describe --dirty --long --always) -VERSION := $(shell cat ./VERSION) +EXTRA_VERSION := +VERSION := $(shell cat ./VERSION)$(EXTRA_VERSION) LDFLAGS_COMMON := -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) GOARCH := $(shell $(GO) env GOARCH) diff --git a/README.md b/README.md index 2c855e3c23e..88497c16945 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,17 @@ sudo make install `runc` will be installed to `/usr/local/sbin/runc` on your system. +#### Version string customization + +You can see the runc version by running `runc --version`. You can append a custom string to the +version using the `EXTRA_VERSION` make variable when building, e.g.: + +```bash +make EXTRA_VERSION="+build-1" +``` + +Bear in mind to include some separator for readability. + #### Build Tags `runc` supports optional build tags for compiling support of various features,