Skip to content

Commit

Permalink
fixup podvm_mkosi makefile
Browse files Browse the repository at this point in the history
Run as sudo to avoid permissions error

!fixup podvm-mkosi: permissions for nix and skip qcow2 docker image build
  • Loading branch information
stevenhorsman committed Oct 28, 2024
1 parent bf65fe5 commit 146438d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/cloud-api-adaptor/podvm-mkosi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ else ifeq ($(ARCH),s390x)
sudo -E ../hack/build-s390x-image.sh
else
touch resources/buildBootableImage
nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=production
sudo -E env PATH=$(PATH) nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=production
qemu-img convert -f raw -O qcow2 build/system.raw build/podvm-amd64.qcow2
endif
@echo "Building docker image..."
sudo chown -R $(USER): build
docker buildx build \
-t $(PODVM_IMAGE) \
--build-arg ARCH=$(ARCH) \
$(DOCKER_OPTS) \
-f ../podvm/Dockerfile.podvm.fedora .
# @echo "Building docker image..."
# sudo chown -R $(USER): build
# docker buildx build \
# -t $(PODVM_IMAGE) \
# --build-arg ARCH=$(ARCH) \
# $(DOCKER_OPTS) \
# -f ../podvm/Dockerfile.podvm.fedora .

PHONY: image-debug
image-debug:
Expand All @@ -118,17 +118,17 @@ else ifeq ($(ARCH),s390x)
@echo "Building docker image..."
else
touch resources/buildBootableImage
nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=debug
sudo -E env PATH=$(PATH) nix develop ..#podvm-mkosi --command mkosi --environment=VARIANT_ID=debug
qemu-img convert -f raw -O qcow2 build/system.raw build/podvm-amd64.qcow2
endif
sudo chown -R $(USER): build
# TODO - once we ditch the packer approach we should consider using oras to wrap
# the qcow2, rather than our own very similar approach
docker buildx build \
-t $(addsuffix -debug,$(PODVM_IMAGE)) \
--build-arg ARCH=$(ARCH) \
$(DOCKER_OPTS) \
-f ../podvm/Dockerfile.podvm.fedora .
# sudo chown -R $(USER): build
# # TODO - once we ditch the packer approach we should consider using oras to wrap
# # the qcow2, rather than our own very similar approach
# docker buildx build \
# -t $(addsuffix -debug,$(PODVM_IMAGE)) \
# --build-arg ARCH=$(ARCH) \
# $(DOCKER_OPTS) \
# -f ../podvm/Dockerfile.podvm.fedora .

PHONY: image-container
image-container:
Expand Down

0 comments on commit 146438d

Please sign in to comment.