diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..a6870a3 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,23 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v5 + with: + target: qemu-base + cache-from: type=gha + cache-to: type=gha,mode=max + + diff --git a/Dockerfile b/Dockerfile index 3458fa8..0daecc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,9 +74,10 @@ ENV PATH=/opt/bin:$PATH # First boot, disable xochitl, sync time, and save state RUN run_vm.sh -serial null -daemonize && \ - ssh -o StrictHostKeyChecking=no root@localhost 'systemctl stop rm-sync && systemctl mask rm-sync' && \ - ssh -o StrictHostKeyChecking=no root@localhost 'systemctl mask xochitl' && \ - ssh -o StrictHostKeyChecking=no root@localhost 'while ! timedatectl status | grep "synchronized: yes"; do sleep 1; done' && \ + wait_ssh.sh && \ + ssh root@localhost 'systemctl stop rm-sync && systemctl mask rm-sync' && \ + ssh root@localhost 'systemctl mask xochitl' && \ + ssh root@localhost 'while ! timedatectl status | grep "synchronized: yes"; do sleep 1; done' && \ save_vm.sh # Mount to presist rootfs diff --git a/bin/wait_ssh.sh b/bin/wait_ssh.sh new file mode 100755 index 0000000..d483def --- /dev/null +++ b/bin/wait_ssh.sh @@ -0,0 +1,7 @@ +#!/bin/sh +echo "Waiting for ssh to come up..." +while ! ssh -o StrictHostKeyChecking=no root@localhost true +do + sleep 1 +done +echo "Done!"