Skip to content

Commit

Permalink
podvm-mkosi: set IMAGE_NAME instead of cp .git
Browse files Browse the repository at this point in the history
Copying the .git folder can lead to problems, e.g. if the make process
abortis, the extra .git folder is not removed and causes confusion in
the working tree.

Since the IMAGE_NAME doesn't matter for the mkosi binary builds, we can
set it explicitly to a static variable.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
  • Loading branch information
mkulke committed Aug 12, 2024
1 parent c1034d0 commit 46b0f9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/cloud-api-adaptor/podvm-mkosi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ PHONY: binaries
binaries:
@echo "Building binaries..."
rm -rf ./resources/binaries-tree
cp -rf ../../../.git ../../.git
ifeq ($(IS_DEBIAN),true)
docker buildx use default
endif
Expand All @@ -56,11 +55,11 @@ endif
--build-arg PAUSE_REPO=$(PAUSE_REPO) \
--build-arg PAUSE_VERSION=$(PAUSE_VERSION) \
--build-arg PAUSE_BIN=$(PAUSE_BIN) \
--build-arg IMAGE_NAME=mkosi-podvm-binaries \
$(if $(AUTHFILE),--build-arg AUTHFILE=$(AUTHFILE),) \
$(if $(DEFAULT_AGENT_POLICY_FILE),--build-arg DEFAULT_AGENT_POLICY_FILE=$(DEFAULT_AGENT_POLICY_FILE),) \
-o type=local,dest="./resources/binaries-tree" \
-f ../podvm/Dockerfile.podvm_binaries.fedora ../../
rm -rf ../../.git

PHONY: image
image:
Expand Down
2 changes: 2 additions & 0 deletions src/cloud-api-adaptor/podvm/Dockerfile.podvm_binaries.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ARG AUTHFILE
ARG PAUSE_REPO
ARG PAUSE_VERSION
ARG PAUSE_BIN
ARG IMAGE_NAME

ENV AUTHFILE=${AUTHFILE}
ENV PAUSE_REPO=${PAUSE_REPO}
Expand All @@ -36,6 +37,7 @@ ENV GUEST_COMPONENTS_REPO=${GUEST_COMPONENTS_REPO}
ENV ATTESTER=${ATTESTER}
ENV ARCH=${ARCH}
ENV DEFAULT_AGENT_POLICY_FILE=${DEFAULT_AGENT_POLICY_FILE}
ENV IMAGE_NAME=${IMAGE_NAME}

# Set these as they are required in the Makefile
ENV IMAGE_URL="none"
Expand Down

0 comments on commit 46b0f9f

Please sign in to comment.