mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-22 08:08:07 +00:00
passes KUBEBENCH_VERSION down to Dockerfile (#428)
This commit is contained in:
parent
4416e46967
commit
91dfeb7577
@ -4,7 +4,8 @@ ADD go.mod go.sum ./
|
||||
ADD main.go .
|
||||
ADD check/ check/
|
||||
ADD cmd/ cmd/
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 go install -a -ldflags '-w'
|
||||
ARG KUBEBENCH_VERSION
|
||||
RUN GO111MODULE=on CGO_ENABLED=0 go install -a -ldflags "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=${KUBEBENCH_VERSION} -w"
|
||||
|
||||
FROM alpine:3.10 AS run
|
||||
WORKDIR /opt/kube-bench/
|
||||
|
3
makefile
3
makefile
@ -4,7 +4,7 @@ DOCKER_REGISTRY ?= aquasec
|
||||
VERSION ?= $(shell git rev-parse --short=7 HEAD)
|
||||
KUBEBENCH_VERSION ?= $(shell git describe --tags --abbrev=0)
|
||||
IMAGE_NAME ?= $(DOCKER_REGISTRY)/$(BINARY):$(VERSION)
|
||||
TARGET_OS := linux
|
||||
TARGET_OS ?= linux
|
||||
BUILD_OS := linux
|
||||
uname := $(shell uname -s)
|
||||
|
||||
@ -29,6 +29,7 @@ $(BINARY): $(SOURCES)
|
||||
build-docker:
|
||||
docker build --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
--build-arg VCS_REF=$(shell git rev-parse --short HEAD) \
|
||||
--build-arg KUBEBENCH_VERSION=$(KUBEBENCH_VERSION) \
|
||||
-t $(IMAGE_NAME) .
|
||||
|
||||
tests:
|
||||
|
Loading…
Reference in New Issue
Block a user