Skip to content

Commit

Permalink
Makefile: Add EXTRA_VERSION
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit cc2078c)
  • Loading branch information
rata committed Aug 19, 2024
1 parent 18cdc34 commit 0514204
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ PROJECT := github.com/opencontainers/runc
BUILDTAGS ?= seccomp

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)
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ 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

Expand Down

0 comments on commit 0514204

Please sign in to comment.