Skip to content

Commit

Permalink
Adding labels Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
krol3 committed Mar 16, 2021
1 parent ec34648 commit 7492580
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,24 @@ RUN apk --no-cache update && apk --no-cache add libc6-compat elfutils-dev

# final image
FROM $BASE
ARG VERSION
ARG BUILD_DATE
ARG VCS_BRANCH
ARG VCS_REF
WORKDIR /tracee

COPY --from=falcosecurity/falcosidekick@sha256:a32d8850d51e9b096a09f4ae73ba6cde038c3fe1fd9c58baf76333dfda7e7bbd /app/falcosidekick ./
COPY --from=build /tracee/dist/tracee-ebpf /tracee/dist/tracee-rules /tracee/entrypoint.sh ./
COPY --from=build /tracee/dist/rules ./rules

LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="Linux Runtime Security and Forensics using eBPF" \
org.label-schema.name="tracee" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-branch=$VCS_BRANCH \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/aquasecurity/tracee" \
org.label-schema.vendor="Aqua Security" \
org.label-schema.version=$VERSION

ENTRYPOINT ["./entrypoint.sh"]
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ PUSH_DOCKER_TAG ?= $(RELEASE_TAG:v%=%)
RELEASE_FILES := LICENSE $(OUT_DIR)/tracee-ebpf $(OUT_DIR)/tracee-rules $(OUT_DIR)/rules
# RELEASE_TAG must be set for the release target
VERSION ?= $(if $(RELEASE_TAG),$(RELEASE_TAG),$(shell $(CMD_GIT) describe --tags 2>/dev/null || echo '0'))
BUILD_DATE = $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
VCS_REF="$(shell git rev-parse --short HEAD)"
VCS_BRANCH="$(shell git rev-parse --abbrev-ref HEAD)"
BUILD_ARG_DOCKER =--build-arg VERSION=$(VERSION) --build-arg BUILD_DATE=$(BUILD_DATE) --build-arg VCS_BRANCH=$(VCS_BRANCH) --build-arg VCS_REF=$(VCS_REF)

CMD_DOCKER ?= docker
CMD_GIT ?= git
Expand Down Expand Up @@ -50,11 +54,11 @@ $(OUT_ARCHIVE) $(OUT_CHECKSUMS) &: $(RELEASE_FILES) | $(OUT_DIR)

.PHONY: docker
docker:
$(CMD_DOCKER) build --build-arg VERSION=$(VERSION) -t $(OUT_DOCKER):latest .
$(CMD_DOCKER) build $(BUILD_ARG_DOCKER) -t $(OUT_DOCKER):latest .

.PHONY: docker-slim
docker-slim:
$(CMD_DOCKER) build --build-arg VERSION=$(VERSION) -t $(OUT_DOCKER):slim --build-arg BASE=slim .
$(CMD_DOCKER) build $(BUILD_ARG_DOCKER) -t $(OUT_DOCKER):slim --build-arg BASE=slim .

# release_docker_image accepts a docker image $1, pushes it as $2 to remote repository, and records it in the release notes
define release_docker_image
Expand Down

0 comments on commit 7492580

Please sign in to comment.