This repository provides a Docker-based build system for creating ImageMagick RPMs that can be distributed via a custom repository.
This build system:
- Creates ImageMagick RPMs from source using Amazon Linux base image
- Packages them into a distributable repository structure
- Provides easy installation scripts for client systems
- Uses GitHub Actions for automated builds
├── Dockerfile # Docker build file for ImageMagick
├── ImageMagick.spec # RPM spec file for ImageMagick
├── ImageMagick.keyring # GPG keyring for verification
├── sources # Source checksums file
├── test-build-simple.sh # Local build test script
└── .github/workflows/
└── build-imagemagick-simple.yml # GitHub Actions workflow
- Docker installed and running
- Git
-
Clone this repository:
git clone https://github.com/mobilecause/imagemagick.git cd imagemagick -
Build the Docker image:
docker build -f Dockerfile -t imagemagick-builder . -
Extract the built RPMs:
mkdir -p output docker run --rm -v $(pwd)/output:/output imagemagick-builder bash -c " cp /home/builder/output/*.rpm /output/ 2>/dev/null || true chown -R $(id -u):$(id -g) /output/ "
-
Built RPMs will be available in the
output/directory.
For a quick local test, you can use the provided test script:
./test-build-simple.shThis script automates the Docker build and extraction process.
The repository includes a GitHub Actions workflow that automatically builds ImageMagick RPMs.
- Go to the "Actions" tab in your GitHub repository
- Select "Build ImageMagick RPM (Simple)"
- Click "Run workflow"
After the workflow completes:
- Go to the workflow run
- Download the artifacts:
imagemagick-complete-x86_64: Complete repository structureimagemagick-x86_64-rpms: Individual RPM files
If you've published the repository structure to GitHub:
# Download and run the installation script
curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/imagemagick-repo/client-setup/install.sh | sudo bash
# Install ImageMagick
sudo dnf install ImageMagick ImageMagick-devel-
Download the repository configuration:
sudo curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/imagemagick-repo/client-setup/imagemagick-build.repo \ -o /etc/yum.repos.d/imagemagick-build.repo
-
Refresh package cache:
sudo dnf clean all sudo dnf makecache
-
Install ImageMagick:
sudo dnf install ImageMagick ImageMagick-devel
# Check version
convert --version
# or
magick --version
# Verify package source
dnf info ImageMagickThe built ImageMagick includes support for:
- JPEG, PNG, TIFF, GIF image formats
- WebP, HEIF (if available)
- SVG via librsvg
- PDF via Ghostscript
- Raw camera formats
- OpenEXR for HDR images
- Various image filters and effects
Edit ImageMagick.spec to:
- Change configure options
- Add/remove dependencies
- Modify install paths
- Add patches
Update Dockerfile to install additional build dependencies:
RUN dnf install -y your-additional-package-develThe built repository follows standard YUM/DNF repository structure:
imagemagick-repo/
├── rpm-repo/
│ └── x86_64/
│ ├── repodata/ # Repository metadata
│ └── *.rpm # RPM packages
└── client-setup/
├── imagemagick-build.repo # Repository configuration
└── install.sh # Installation script
- Missing dependencies: Check the Docker build logs for missing packages
- Spec file issues: Verify the ImageMagick.spec file syntax
- Source download failures: Ensure the source URLs in the spec file are accessible
- Repository not found: Verify the repository URL is accessible
- GPG errors: The repository is configured with
gpgcheck=0for simplicity - Conflicts: Remove existing ImageMagick packages before installing
# List available ImageMagick packages
dnf list available | grep -i imagemagick
# Remove existing ImageMagick
sudo dnf remove ImageMagick*
# Check repository configuration
dnf repolist | grep imagemagick
# Clean repository cache
sudo dnf clean all && sudo dnf makecache- Fork the repository
- Create your feature branch
- Test your changes locally
- Submit a pull request
This build system follows the ImageMagick license. See the ImageMagick.spec file for details.