fix: switch from docker to podman for Makefile and Gitea Actions workflow

This commit is contained in:
2026-06-04 15:31:06 -04:00
parent 7e1db100a7
commit b0a74982ec
2 changed files with 55 additions and 48 deletions
+40 -39
View File
@@ -28,50 +28,51 @@ jobs:
# Strip leading 'v' from tag name: v0.0.0-alpha2 -> 0.0.0-alpha2 # Strip leading 'v' from tag name: v0.0.0-alpha2 -> 0.0.0-alpha2
ROC_VERSION="${GITHUB_REF_NAME#v}" ROC_VERSION="${GITHUB_REF_NAME#v}"
echo "roc_version=${ROC_VERSION}" >> "$GITHUB_OUTPUT" echo "roc_version=${ROC_VERSION}" >> "$GITHUB_OUTPUT"
echo "ROC_VERSION=${ROC_VERSION}" >> "$GITHUB_ENV"
- name: Set up Docker Buildx - name: Log in to container registry
uses: docker/setup-buildx-action@v3 env:
ROC_VERSION: ${{ steps.version.outputs.roc_version }}
- name: Log in to registry
run: | run: |
echo "$REGISTRY_PASSWORD" | docker login $REGISTRY -u $REGISTRY_USER --password-stdin echo "$REGISTRY_PASSWORD" | podman login $REGISTRY -u $REGISTRY_USER --password-stdin
- name: Build and push base image - name: Build and push base image
uses: docker/build-push-action@v6 env:
with: ROC_VERSION: ${{ steps.version.outputs.roc_version }}
context: . run: |
target: base podman build \
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }} -f Containerfile \
tags: | --target base \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-base:${{ steps.version.outputs.roc_version }} --build-arg ROC_VERSION="${ROC_VERSION}" \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-base:latest -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:${ROC_VERSION}" \
push: true -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:latest" \
cache-from: type=gha .
cache-to: type=gha,mode=max podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:${ROC_VERSION}"
podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:latest"
- name: Build and push dev image - name: Build and push dev image
uses: docker/build-push-action@v6 env:
with: ROC_VERSION: ${{ steps.version.outputs.roc_version }}
context: . run: |
target: dev podman build \
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }} -f Containerfile \
tags: | --target dev \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-dev:${{ steps.version.outputs.roc_version }} --build-arg ROC_VERSION="${ROC_VERSION}" \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-dev:latest -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:${ROC_VERSION}" \
push: true -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:latest" \
cache-from: type=gha .
cache-to: type=gha,mode=max podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:${ROC_VERSION}"
podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:latest"
- name: Build and push ci image - name: Build and push ci image
uses: docker/build-push-action@v6 env:
with: ROC_VERSION: ${{ steps.version.outputs.roc_version }}
context: . run: |
target: ci podman build \
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }} -f Containerfile \
tags: | --target ci \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-ci:${{ steps.version.outputs.roc_version }} --build-arg ROC_VERSION="${ROC_VERSION}" \
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-ci:latest -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:${ROC_VERSION}" \
push: true -t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:latest" \
cache-from: type=gha .
cache-to: type=gha,mode=max podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:${ROC_VERSION}"
podman push "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:latest"
+15 -9
View File
@@ -1,10 +1,14 @@
ROC_VERSION ?= 0.0.0-alpha2 ROC_VERSION ?= 0.0.0-alpha2
REGISTRY ?= git.roo.lol/jbrechtel REGISTRY ?= git.roo.lol/jbrechtel
# Use podman by default; override with: make BUILD_CMD=docker
BUILD_CMD ?= podman
BUILD_FLAGS ?= -f Containerfile
.PHONY: build-base build-dev build-ci build-all push-base push-dev push-ci push-all .PHONY: build-base build-dev build-ci build-all push-base push-dev push-ci push-all
build-base: build-base:
docker build \ $(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target base \ --target base \
--build-arg ROC_VERSION=$(ROC_VERSION) \ --build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-base:$(ROC_VERSION) \ -t $(REGISTRY)/roc-tools-base:$(ROC_VERSION) \
@@ -12,7 +16,8 @@ build-base:
. .
build-dev: build-dev:
docker build \ $(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target dev \ --target dev \
--build-arg ROC_VERSION=$(ROC_VERSION) \ --build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-dev:$(ROC_VERSION) \ -t $(REGISTRY)/roc-tools-dev:$(ROC_VERSION) \
@@ -20,7 +25,8 @@ build-dev:
. .
build-ci: build-ci:
docker build \ $(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target ci \ --target ci \
--build-arg ROC_VERSION=$(ROC_VERSION) \ --build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-ci:$(ROC_VERSION) \ -t $(REGISTRY)/roc-tools-ci:$(ROC_VERSION) \
@@ -30,15 +36,15 @@ build-ci:
build-all: build-base build-dev build-ci build-all: build-base build-dev build-ci
push-base: push-base:
docker push $(REGISTRY)/roc-tools-base:$(ROC_VERSION) $(BUILD_CMD) push $(REGISTRY)/roc-tools-base:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-base:latest $(BUILD_CMD) push $(REGISTRY)/roc-tools-base:latest
push-dev: push-dev:
docker push $(REGISTRY)/roc-tools-dev:$(ROC_VERSION) $(BUILD_CMD) push $(REGISTRY)/roc-tools-dev:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-dev:latest $(BUILD_CMD) push $(REGISTRY)/roc-tools-dev:latest
push-ci: push-ci:
docker push $(REGISTRY)/roc-tools-ci:$(ROC_VERSION) $(BUILD_CMD) push $(REGISTRY)/roc-tools-ci:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-ci:latest $(BUILD_CMD) push $(REGISTRY)/roc-tools-ci:latest
push-all: build-all push-base push-dev push-ci push-all: build-all push-base push-dev push-ci