MCJack123 / sanjuuni

Converts images and videos into a format that can be displayed in ComputerCraft.
GNU General Public License v2.0
32 stars 5 forks source link

Docker support #24

Open Commandcracker opened 2 months ago

Commandcracker commented 2 months ago

Resolves #23

To do:

Erb3 commented 2 months ago

Here is a CI/CD workflow that magically works for me, no other setup required

.github/workflows/docker-image.yml
name: Create and publish a Docker image

on:
  release:
    types:
      - published
  workflow_dispatch:

env:
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  build-and-push-image:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Log in to the Container registry
        uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
        with:
          images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

      - name: Build and push Docker image
        uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
Commandcracker commented 2 months ago

I wont do AMD because i don't own a AMD GPU.

Commandcracker commented 2 months ago

@Erb3

Here is a CI/CD workflow that magically works for me, no other setup required

Ill do something a bit more "advanced" :D

Erb3 commented 1 month ago

How did you get it to load files? I've tried numerous commands, but never been able to get it to load a file. "Could not open input file: No such file or directory"

Commandcracker commented 1 month ago

How did you get it to load files? I've tried numerous commands, but never been able to get it to load a file. "Could not open input file: No such file or directory"

Are you using relative paths from . that are not going outside of it (not ..) ?

Erb3 commented 1 month ago

[snip]

Are you using relative paths from . that are not going outside of it (not ..) ?

$ docker run --rm -v .:/srv/sanjuuni sanjuuni -ifile ./avatar2.png -ofile ./output.lua
Could not open input file: No such file or directory
$ file ./avatar2.png
./avatar2.png: PNG image data, 1890 x 1827, 8-bit/color RGBA, non-interlaced