fix: use existing Docker daemon instead of starting new one (#226)
The CI runner already has a working Docker daemon and the runner user is in the docker group. All previous failures were caused by the workflow trying to start a NEW dockerd instance with vfs storage driver. Solution: Remove all daemon startup code and just use the existing Docker daemon directly. The runner user already has access via group membership. Verified on ci host: - Docker service running: overlayfs storage driver - runner user in docker group: uid=1001(runner) groups=1001(runner),989(docker) - docker info works as runner user This is the simplest solution and should have been tried first. Reviewed-on: graham/towerops-web#226
This commit is contained in:
parent
a0b916cc9a
commit
344c6658e8
1 changed files with 10 additions and 19 deletions
|
|
@ -100,35 +100,26 @@ jobs:
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
echo "Full image tag: ${TAG}"
|
echo "Full image tag: ${TAG}"
|
||||||
|
|
||||||
- name: Install img
|
- name: Build and push Docker image
|
||||||
run: |
|
|
||||||
curl -fsSL https://github.com/genuinetools/img/releases/download/v0.5.11/img-linux-amd64 -o /tmp/img
|
|
||||||
sudo install /tmp/img /usr/local/bin/img
|
|
||||||
rm /tmp/img
|
|
||||||
|
|
||||||
- name: Build and push with img
|
|
||||||
run: |
|
run: |
|
||||||
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
|
IMAGE_TAG="${{ steps.tag.outputs.tag }}"
|
||||||
|
|
||||||
# Build with img (completely unprivileged, no capabilities needed)
|
# Build using existing Docker daemon (runner user is in docker group)
|
||||||
img build \
|
docker build \
|
||||||
--build-arg MIX_ENV=prod \
|
--build-arg MIX_ENV=prod \
|
||||||
--file k8s/Dockerfile \
|
--file k8s/Dockerfile \
|
||||||
--tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
--tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
||||||
|
--tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production" \
|
||||||
.
|
.
|
||||||
|
|
||||||
# Login and push
|
# Login and push both tags
|
||||||
img login \
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login \
|
||||||
-u "${{ secrets.REGISTRY_USER }}" \
|
--username "${{ secrets.REGISTRY_USER }}" \
|
||||||
-p "${{ secrets.REGISTRY_PASSWORD }}" \
|
--password-stdin \
|
||||||
"${{ secrets.REGISTRY_URL }}"
|
"${{ secrets.REGISTRY_URL }}"
|
||||||
|
|
||||||
img push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}"
|
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}"
|
||||||
|
docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production"
|
||||||
# Tag and push production
|
|
||||||
img tag "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}" \
|
|
||||||
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:production"
|
|
||||||
img 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