File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,15 @@ jobs:
5151 - name : Build the agent container image
5252 id : build
5353 run : |
54- apt-get update && apt-get install -y make git
54+ apt-get update && apt-get install -y make git jq
5555 cd agent
5656 export TAGS="-t ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:${{ github.sha }}"
5757 export REGISTRY=${REGISTRY@L}
5858 # Get the last tag and use it as the env var AGENT_VERSION if it doesn't exist use 0.0.0+{github.sha}
5959 export AGENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0+${{ github.sha }}")
6060 make docker-build-only agent_version=${AGENT_VERSION}
61- echo "digest=$(docker inspect --format='{{index .RepoDigests 0}}' ${REGISTRY@L}/${{env.IMAGE_NAME}}/agent:${{ github.sha }} | cut -d: -f2)" >> $GITHUB_OUTPUT
61+ cat metadata.json
62+ echo "digest=$(cat metadata.json | jq -r .containerimage.digest)" >> $GITHUB_OUTPUT
6263 env :
6364 AGENT_IMAGE : ${{env.IMAGE_NAME}}/agent
6465
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ ACTUAL_TAGS=$(shell echo "-t $(REGISTRY)/$(AGENT_IMAGE):$(shell date +%y.%m.%d-%
7171.PHONY : docker-build-only
7272docker-build-only :
7373 @echo " Building skyhook-agent $( DOCKER_CMD) image with tags: $( ACTUAL_TAGS) "
74- $(DOCKER_CMD ) buildx build $(BUILD_ARGS ) --build-arg AGENT_VERSION=$(AGENT_VERSION ) --platform linux/amd64,linux/arm64 $(ACTUAL_TAGS ) -f docker/Dockerfile .
74+ $(DOCKER_CMD ) buildx build $(BUILD_ARGS ) --build-arg AGENT_VERSION=$(AGENT_VERSION ) --platform linux/amd64,linux/arm64 $(ACTUAL_TAGS ) --metadata-file=metadata.json - f docker/Dockerfile .
7575
7676# #@ Docker Build
7777.PHONY : docker-build
Original file line number Diff line number Diff line change 1- FROM python:3.12-alpine as builder
1+ FROM python:3.12-alpine AS builder
22
33ARG AGENT_VERSION
44
@@ -7,6 +7,7 @@ WORKDIR /code
77RUN echo "AGENT_VERSION=${AGENT_VERSION}"
88RUN apk update && apk add bash make
99RUN make venv
10+ RUN make test
1011RUN make build build_version=${AGENT_VERSION}
1112
1213FROM python:3.12-alpine
You can’t perform that action at this time.
0 commit comments