1
0
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:
Roberto Rojas 2019-10-12 18:53:17 -04:00 committed by GitHub
parent 4416e46967
commit 91dfeb7577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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/

View File

@ -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: