From 41c7c94a34af3d459a9af888f292866fdb5982cc Mon Sep 17 00:00:00 2001 From: Dylan Reimerink Date: Sun, 29 Dec 2024 16:10:52 +0100 Subject: [PATCH] Remove podman option from Makefile and modify html target CI was failing, removing the podman option from the Makefile and modifying the html target to run docker in non-interative mode seems to have resolved the issue. Signed-off-by: Dylan Reimerink --- Makefile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 315ef5b..c3edd51 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,6 @@ REPODIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) UIDGID := $(shell stat -c '%u:%g' ${REPODIR}) -# Prefer podman if installed, otherwise use docker. -# Note: Setting the var at runtime will always override. -CONTAINER_ENGINE ?= $(if $(shell command -v podman), podman, docker) -CONTAINER_RUN_ARGS ?= $(if $(filter ${CONTAINER_ENGINE}, podman), --log-driver=none, --user "${UIDGID}") - IMAGE := ghcr.io/isovalent/ebpf-docs VERSION := $(shell cat ${REPODIR}/tools/image-version) @@ -20,22 +15,22 @@ default: serve ; .PHONY: build-container build-container: $(eval EPOCH := $(shell date +%s)) - ${CONTAINER_ENGINE} build -f ${REPODIR}/tools/Dockerfile -t ${IMAGE}:$(EPOCH) ${REPODIR} + docker build -f ${REPODIR}/tools/Dockerfile -t ${IMAGE}:$(EPOCH) ${REPODIR} echo $(EPOCH) > ${REPODIR}/tools/image-version .PHONY: push-container push-container: - ${CONTAINER_ENGINE} push ${IMAGE}:${VERSION} + docker push ${IMAGE}:${VERSION} .PHONY: container-shell container-shell: - ${CONTAINER_ENGINE} run --rm -it -v "${REPODIR}:/docs" -e "GH_TOKEN=${GH_TOKEN}" \ + docker run --rm -it -v "${REPODIR}:/docs" -e "GH_TOKEN=${GH_TOKEN}" \ -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" \ -w /docs "${IMAGE}:${VERSION}" .PHONY: html html: - ${CONTAINER_ENGINE} run --rm -it -v "${REPODIR}:/docs" \ + docker run --rm -v "${REPODIR}:/docs" \ -e "PROD=${PROD}" -e "GH_TOKEN=${GH_TOKEN}" \ -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" \ -w /docs "${IMAGE}:${VERSION}" "mkdocs build -d /docs/out" @@ -46,19 +41,19 @@ clear-html: .PHONY: serve serve: - ${CONTAINER_ENGINE} run --rm -it -p 8000:8000 -v "${REPODIR}:/docs" \ + docker run --rm -p 8000:8000 -v "${REPODIR}:/docs" \ -e "PROD=${PROD}" -e "GH_TOKEN=${GH_TOKEN}" \ -w /docs -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" \ "${IMAGE}:${VERSION}" "mkdocs serve -a 0.0.0.0:8000 --watch /docs/docs" .PHONY: build-spellcheck build-spellcheck: - ${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" -w /docs golang:latest bash -c \ + docker run --rm -v "${REPODIR}:/docs" -w /docs golang:latest bash -c \ "CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/spellcheck /docs/tools/spellcheck/." .PHONY: build-gen-tools build-gen-tools: - ${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" -w /docs golang:latest bash -c \ + docker run --rm -v "${REPODIR}:/docs" -w /docs golang:latest bash -c \ "CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/libbpf-tag-gen /docs/tools/libbpf-tag-gen/. && \ CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/helper-ref-gen /docs/tools/helper-ref-gen/. && \ CGO_ENABLED=0 go build -buildvcs=false -o /docs/tools/bin/feature-gen /docs/tools/feature-gen/. && \ @@ -70,7 +65,7 @@ LIBBPF_REF := $(shell cat ${REPODIR}/tools/libbpf-ref) .PHONY: generate-docs generate-docs: build-gen-tools - ${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" \ + docker run --rm -v "${REPODIR}:/docs" \ -w /docs -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" "${IMAGE}:${VERSION}" \ "/docs/tools/bin/helper-ref-gen --project-root /docs && \ /docs/tools/bin/libbpf-tag-gen --project-root /docs --libbpf-ref '${LIBBPF_REF}' && \ @@ -90,6 +85,6 @@ update-libbpf-ref: .PHONY: spellcheck spellcheck: build-spellcheck html - ${CONTAINER_ENGINE} run --rm -v "${REPODIR}:/docs" \ + docker run --rm -v "${REPODIR}:/docs" \ -w /docs -e "AS_USER=$$(id -u $${USER})" -e "AS_GROUP=$$(id -g $${USER})" "${IMAGE}:${VERSION}" \ "/docs/tools/bin/spellcheck --project-root /docs"