Docker Image for ImageMagick
docker pull naoigcat/imagemagickSee imagemagick for available commands.
docker run --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/app naoigcat/imagemagick identify image.pngIt is recommended to create an alias:
alias imagemagick='docker run --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/app naoigcat/imagemagick'You can use this Docker image in your GitHub Actions workflows to process images during CI/CD.
name: Process Image
on: [push]
jobs:
generate:
runs-on: ubuntu-latest
container:
image: naoigcat/imagemagick:latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Create sample image
run: magick -size 200x100 xc:white -gravity center -pointsize 24 -annotate 0 'Sample' output.jpg
- name: Upload sample image
uses: actions/upload-artifact@v4
with:
name: image
path: output.jpgAlternatively, you can use the image with docker run in your workflow:
name: Process Image
on: [push]
jobs:
process:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Create sample image
run: |
docker run --rm --user "$(id -u)":"$(id -g)" -v "$PWD":/app naoigcat/imagemagick \
magick -size 200x100 xc:white -gravity center -pointsize 24 -annotate 0 'Sample' output.jpg
- name: Upload sample image
uses: actions/upload-artifact@v4
with:
name: image
path: output.jpg