Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support #24

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Commandcracker
Copy link

@Commandcracker Commandcracker commented Jul 5, 2024

Resolves #23

To do:

  • Documentation
  • OpenCL support
  • CD Workflow to build and push image to GitHub/Docker Registry

@Erb3
Copy link

Erb3 commented Jul 9, 2024

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
Copy link
Author

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

@Commandcracker
Copy link
Author

@Erb3

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

Ill do something a bit more "advanced" :D

Use a matrix if another image is needed and use buildx if other architectures are needed
@Commandcracker Commandcracker marked this pull request as ready for review July 10, 2024 14:52
@Erb3
Copy link

Erb3 commented Jul 14, 2024

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
Copy link
Author

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
Copy link

Erb3 commented Jul 16, 2024

[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

Copy link

@Erb3 Erb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my machine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker support
2 participants