|
| 1 | +# ASP.NET Noble Ghostscript Docker Image |
| 2 | + |
| 3 | +This repository contains a Docker image based on ASP.NET 10.0 Noble with Ghostscript and zbar-tools installed. |
| 4 | + |
| 5 | +## Docker Image |
| 6 | + |
| 7 | +The Dockerfile creates an image with: |
| 8 | +- Base: `mcr.microsoft.com/dotnet/aspnet:10.0-noble` |
| 9 | +- Ghostscript for PDF processing |
| 10 | +- zbar-tools for barcode/QR code processing |
| 11 | +- Pre-configured GhostScript settings |
| 12 | + |
| 13 | +## GitHub Actions CI/CD |
| 14 | + |
| 15 | +### Nightly Builds |
| 16 | + |
| 17 | +The repository includes a GitHub Actions workflow that: |
| 18 | +- Runs nightly at 2 AM UTC |
| 19 | +- Builds the Docker image |
| 20 | +- Pushes to Azure Container Registry |
| 21 | +- Supports manual triggering via `workflow_dispatch` |
| 22 | + |
| 23 | +### Required GitHub Secrets |
| 24 | + |
| 25 | +To use the GitHub Actions workflow, you need to configure the following secrets in your repository: |
| 26 | + |
| 27 | +1. **ACR_LOGIN_SERVER** - Your Azure Container Registry login server URL |
| 28 | + - Example: `myregistry.azurecr.io` |
| 29 | + |
| 30 | +2. **ACR_USERNAME** - Your Azure Container Registry username |
| 31 | + - Example: `myregistry` (usually the same as registry name) |
| 32 | + |
| 33 | +3. **ACR_PASSWORD** - Your Azure Container Registry password |
| 34 | + - You can get this from Azure Portal > Container Registry > Access Keys |
| 35 | + |
| 36 | +### Setting up GitHub Secrets |
| 37 | + |
| 38 | +1. Go to your GitHub repository |
| 39 | +2. Navigate to Settings > Secrets and variables > Actions |
| 40 | +3. Click "New repository secret" |
| 41 | +4. Add each of the three secrets listed above |
| 42 | + |
| 43 | +### Workflow Features |
| 44 | + |
| 45 | +- **Scheduled builds**: Runs automatically every night at 2 AM UTC |
| 46 | +- **Manual triggers**: Can be triggered manually from the Actions tab |
| 47 | +- **Simple tagging**: Uses only the `latest` tag for all builds |
| 48 | +- **Build caching**: Uses GitHub Actions cache for faster builds |
| 49 | +- **Buildx support**: Uses Docker Buildx for advanced build features |
| 50 | + |
| 51 | +### Image Tags |
| 52 | + |
| 53 | +The workflow creates a single tag: |
| 54 | +- `latest` - All builds are tagged as latest, overwriting the previous version |
| 55 | + |
| 56 | +## Usage |
| 57 | + |
| 58 | +Once the image is built and pushed to your Azure Container Registry, you can pull it using: |
| 59 | + |
| 60 | +```bash |
| 61 | +docker pull <your-registry>.azurecr.io/aspnet-noble-ghostscript:latest |
| 62 | +``` |
| 63 | + |
| 64 | +## Environment Variables |
| 65 | + |
| 66 | +The image includes pre-configured environment variables for GhostScript: |
| 67 | + |
| 68 | +- `GhostScriptSettings__Executable="/usr/bin/gs"` |
| 69 | +- `GhostScriptSettings__Parameter="-sDEVICE=pdfwrite -o \"{1}\" -dCompatibilityLevel=\"1.4\" -dPDFSETTINGS=\"/screen\" -dNOPAUSE -dQUIET -dBATCH \"{0}\""` |
| 70 | +- `GhostScriptSettings__WorkDir="/tmp"` |
0 commit comments