A Docker-like CLI and HTTP API for managing headless VMs

feat: add Dockerfile and CI workflows for building and publishing VMX

+134
+12
.dockerignore
··· 1 + *.iso 2 + *.img 3 + vmconfig.toml 4 + .env 5 + *.fd 6 + vmlinux 7 + *.tar.gz 8 + *.qcow2 9 + *.xz 10 + *.bu 11 + *.ign 12 + seed
+60
.github/workflows/docker-publish.yml
··· 1 + name: ci 2 + on: 3 + push: 4 + tags: 5 + - "*" 6 + workflow_dispatch: 7 + inputs: 8 + tag: 9 + description: "The existing tag to publish" 10 + type: "string" 11 + required: true 12 + 13 + env: 14 + REGISTRY: ghcr.io 15 + 16 + jobs: 17 + publish: 18 + runs-on: ubuntu-latest 19 + permissions: 20 + contents: write 21 + packages: write 22 + steps: 23 + - uses: actions/checkout@v4 24 + with: 25 + submodules: true 26 + - name: Log in to Docker 27 + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 28 + with: 29 + username: ${{ secrets.DOCKERHUB_USERNAME }} 30 + password: ${{ secrets.DOCKERHUB_PASSWORD }} 31 + 32 + - name: Write Github Token to file 33 + run: echo $GITHUB_TOKEN > .github_token 34 + env: 35 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 36 + 37 + - name: Build and Publish image to Docker Hub 38 + uses: fluentci-io/setup-fluentci@v5 39 + with: 40 + wasm: true 41 + plugin: buildx 42 + args: | 43 + build_cloud --platform linux/amd64,linux/arm64 -t tsiry/vmx:latest . "--build-arg GITHUB_TOKEN=\"${GITHUB_ACCESS_TOKEN}\" --build-arg TAG=\"${TAG}\"" --push 44 + env: 45 + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 46 + BUILDX_BUILDER: tsiry/rockbox-builder 47 + TAG: ${{ inputs.tag || github.ref_name }} 48 + 49 + - name: Log in to Github Container Registry 50 + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 51 + with: 52 + registry: ${{ env.REGISTRY }} 53 + username: ${{ github.actor }} 54 + password: ${{ secrets.GITHUB_TOKEN }} 55 + 56 + - name: Publish to Github Container Registry 57 + run: | 58 + docker pull tsiry/vmx:latest 59 + docker tag tsiry/vmx:latest ghcr.io/tsirysndr/vmx:latest 60 + docker push ghcr.io/tsirysndr/vmx:latest
+43
.github/workflows/release.yml
··· 1 + name: release 2 + on: 3 + release: 4 + types: [created] 5 + 6 + jobs: 7 + build: 8 + name: release 9 + runs-on: ubuntu-latest 10 + strategy: 11 + matrix: 12 + target: 13 + - x86_64-unknown-linux-gnu 14 + - aarch64-unknown-linux-gnu 15 + - x86_64-apple-darwin 16 + - aarch64-apple-darwin 17 + steps: 18 + - uses: actions/checkout@v3 19 + - name: Setup Fluent CI 20 + uses: fluentci-io/setup-fluentci@v5 21 + env: 22 + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 23 + - uses: denoland/setup-deno@v2 24 + - name: Compile 25 + run: | 26 + rm deno.lock || true 27 + deno compile -A --no-check --output vmx --target ${{ matrix.target }} main.ts 28 + - name: Set env 29 + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 30 + - name: Archive assets 31 + run: | 32 + tar czvf vmx_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz vmx 33 + shasum -a 256 vmx_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > vmx_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 34 + - name: Upload release assets 35 + run: | 36 + for ext in tar.gz tar.gz.sha256; do 37 + export FILE=vmx_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.$ext 38 + fluentci run --wasm github release_upload $TAG $FILE 39 + done 40 + env: 41 + TAG: ${{ env.RELEASE_VERSION }} 42 + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+19
Dockerfile
··· 1 + FROM denoland/deno:latest AS builder 2 + 3 + WORKDIR /app 4 + 5 + COPY deno.json deno.lock ./ 6 + 7 + RUN deno install 8 + 9 + COPY . . 10 + 11 + RUN deno compile -A -o vmx ./main.ts 12 + 13 + FROM ubuntu:latest 14 + 15 + COPY --from=builder /app/vmx /usr/local/bin/vmx 16 + 17 + RUN vmx --version 18 + 19 + ENTRYPOINT ["vmx"]