mirror of
https://github.com/aquasecurity/kube-bench.git
synced 2024-11-22 16:18: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 main.go .
|
||||||
ADD check/ check/
|
ADD check/ check/
|
||||||
ADD cmd/ cmd/
|
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
|
FROM alpine:3.10 AS run
|
||||||
WORKDIR /opt/kube-bench/
|
WORKDIR /opt/kube-bench/
|
||||||
|
3
makefile
3
makefile
@ -4,7 +4,7 @@ DOCKER_REGISTRY ?= aquasec
|
|||||||
VERSION ?= $(shell git rev-parse --short=7 HEAD)
|
VERSION ?= $(shell git rev-parse --short=7 HEAD)
|
||||||
KUBEBENCH_VERSION ?= $(shell git describe --tags --abbrev=0)
|
KUBEBENCH_VERSION ?= $(shell git describe --tags --abbrev=0)
|
||||||
IMAGE_NAME ?= $(DOCKER_REGISTRY)/$(BINARY):$(VERSION)
|
IMAGE_NAME ?= $(DOCKER_REGISTRY)/$(BINARY):$(VERSION)
|
||||||
TARGET_OS := linux
|
TARGET_OS ?= linux
|
||||||
BUILD_OS := linux
|
BUILD_OS := linux
|
||||||
uname := $(shell uname -s)
|
uname := $(shell uname -s)
|
||||||
|
|
||||||
@ -29,6 +29,7 @@ $(BINARY): $(SOURCES)
|
|||||||
build-docker:
|
build-docker:
|
||||||
docker build --build-arg BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
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 VCS_REF=$(shell git rev-parse --short HEAD) \
|
||||||
|
--build-arg KUBEBENCH_VERSION=$(KUBEBENCH_VERSION) \
|
||||||
-t $(IMAGE_NAME) .
|
-t $(IMAGE_NAME) .
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
|
Loading…
Reference in New Issue
Block a user