Skip to content
Snippets Groups Projects
Unverified Commit 91dfeb75 authored by Roberto Rojas's avatar Roberto Rojas Committed by GitHub
Browse files

passes KUBEBENCH_VERSION down to Dockerfile (#428)

parent 4416e469
No related branches found
No related tags found
No related merge requests found
......@@ -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/
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment