fix: use Podman instead of non-existent Kaniko binary (#223)
Kaniko doesn't provide standalone binary downloads - it's distributed as a container image. The download URL returns 404. Solution: Use Podman which: - Available as standard apt package - Runs rootless without daemon - Works on unprivileged runners - Docker-compatible CLI This avoids both the Docker namespace issue and the missing Kaniko binary. Reviewed-on: graham/towerops-web#223
This commit is contained in:
parent
284898dc2f
commit
964b16780d
1 changed files with 19 additions and 16 deletions
|
|
@ -100,28 +100,31 @@ jobs:
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
echo "Full image tag: ${TAG}"
|
echo "Full image tag: ${TAG}"
|
||||||
|
|
||||||
- name: Install Kaniko
|
- name: Install Podman
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL https://github.com/GoogleContainerTools/kaniko/releases/latest/download/executor-linux-amd64 \
|
sudo apt-get update
|
||||||
-o /usr/local/bin/kaniko
|
sudo apt-get install -y podman
|
||||||
chmod +x /usr/local/bin/kaniko
|
|
||||||
|
|
||||||
- name: Build and push with Kaniko
|
- name: Build and push with Podman
|
||||||
run: |
|
run: |
|
||||||
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
|
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
|
||||||
REGISTRY_AUTH=$(echo -n "${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PASSWORD }}" | base64 -w 0)
|
|
||||||
|
|
||||||
mkdir -p /tmp/kaniko-docker
|
# Build image with Podman (rootless, works on unprivileged runners)
|
||||||
echo "{\"auths\":{\"${{ secrets.REGISTRY_URL }}\":{\"auth\":\"${REGISTRY_AUTH}\"}}}" \
|
podman build \
|
||||||
> /tmp/kaniko-docker/config.json
|
--build-arg MIX_ENV=prod \
|
||||||
|
--file k8s/Dockerfile \
|
||||||
|
--tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
||||||
|
--tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production" \
|
||||||
|
.
|
||||||
|
|
||||||
/usr/local/bin/kaniko \
|
# Login and push both tags
|
||||||
--context="${GITHUB_WORKSPACE}" \
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | podman login \
|
||||||
--dockerfile="${GITHUB_WORKSPACE}/k8s/Dockerfile" \
|
--username "${{ secrets.REGISTRY_USER }}" \
|
||||||
--build-arg="MIX_ENV=prod" \
|
--password-stdin \
|
||||||
--docker-config=/tmp/kaniko-docker \
|
"${{ secrets.REGISTRY_URL }}"
|
||||||
--destination="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
|
||||||
--destination="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production"
|
podman push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}"
|
||||||
|
podman push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production"
|
||||||
|
|
||||||
update-manifest:
|
update-manifest:
|
||||||
name: Update Deployment Manifest
|
name: Update Deployment Manifest
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue