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
ROC_VERSION="${GITHUB_REF_NAME#v}"
echo "roc_version=${ROC_VERSION}" >> "$GITHUB_OUTPUT"
echo "ROC_VERSION=${ROC_VERSION}" >> "$GITHUB_ENV"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
- name: Log in to container registry
env:
ROC_VERSION: ${{ steps.version.outputs.roc_version }}
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
uses: docker/build-push-action@v6
with:
context: .
target: base
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-base:${{ steps.version.outputs.roc_version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-base:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
ROC_VERSION: ${{ steps.version.outputs.roc_version }}
run: |
podman build \
-f Containerfile \
--target base \
--build-arg ROC_VERSION="${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-base:latest" \
.
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
uses: docker/build-push-action@v6
with:
context: .
target: dev
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-dev:${{ steps.version.outputs.roc_version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-dev:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
ROC_VERSION: ${{ steps.version.outputs.roc_version }}
run: |
podman build \
-f Containerfile \
--target dev \
--build-arg ROC_VERSION="${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-dev:latest" \
.
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
uses: docker/build-push-action@v6
with:
context: .
target: ci
build-args: ROC_VERSION=${{ steps.version.outputs.roc_version }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-ci:${{ steps.version.outputs.roc_version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/roc-tools-ci:latest
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
ROC_VERSION: ${{ steps.version.outputs.roc_version }}
run: |
podman build \
-f Containerfile \
--target ci \
--build-arg ROC_VERSION="${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:${ROC_VERSION}" \
-t "$REGISTRY/$IMAGE_NAMESPACE/roc-tools-ci:latest" \
.
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
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
build-base:
docker build \
$(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target base \
--build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-base:$(ROC_VERSION) \
@@ -12,7 +16,8 @@ build-base:
.
build-dev:
docker build \
$(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target dev \
--build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-dev:$(ROC_VERSION) \
@@ -20,7 +25,8 @@ build-dev:
.
build-ci:
docker build \
$(BUILD_CMD) build \
$(BUILD_FLAGS) \
--target ci \
--build-arg ROC_VERSION=$(ROC_VERSION) \
-t $(REGISTRY)/roc-tools-ci:$(ROC_VERSION) \
@@ -30,15 +36,15 @@ build-ci:
build-all: build-base build-dev build-ci
push-base:
docker push $(REGISTRY)/roc-tools-base:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-base:latest
$(BUILD_CMD) push $(REGISTRY)/roc-tools-base:$(ROC_VERSION)
$(BUILD_CMD) push $(REGISTRY)/roc-tools-base:latest
push-dev:
docker push $(REGISTRY)/roc-tools-dev:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-dev:latest
$(BUILD_CMD) push $(REGISTRY)/roc-tools-dev:$(ROC_VERSION)
$(BUILD_CMD) push $(REGISTRY)/roc-tools-dev:latest
push-ci:
docker push $(REGISTRY)/roc-tools-ci:$(ROC_VERSION)
docker push $(REGISTRY)/roc-tools-ci:latest
$(BUILD_CMD) push $(REGISTRY)/roc-tools-ci:$(ROC_VERSION)
$(BUILD_CMD) push $(REGISTRY)/roc-tools-ci:latest
push-all: build-all push-base push-dev push-ci