├── .gitignore ├── .gitattributes ├── README.md ├── Dockerfile └── .github └── workflows └── docker-image.yml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | images/* 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker CHD "Compressed Hunks of Data" Converter 2 | Compresses GDI, ISO, BIN and CUE files to CHD using **CHDMAN** from MAME Tools. 3 | 4 | * Skips existing `.chd` files 5 | * Does not delete or modify source files 6 | * Optional: choose between `createcd` (default) or `createdvd` 7 | 8 | --- 9 | 10 | ## Quick Start — CD Conversion (Default) 11 | 12 | ```bash 13 | docker run \ 14 | --rm \ 15 | -v "$(pwd)/isofiles/:/tmp/images/:rw" \ 16 | -it marctv/chd-converter 17 | ``` 18 | 19 | $(pwd)/images/ is the local path. Could also be: 20 | 21 | ```bash 22 | docker run \ 23 | --rm \ 24 | -v "/user/isofiles:/tmp/images/:rw" \ 25 | -it marctv/chd-converter 26 | ``` 27 | 28 | ## createdvd (Optional) 29 | 30 | This is important for PlayStation Portable (PSP) CHD files. 31 | 32 | ```bash 33 | docker run \ 34 | --rm \ 35 | -e CHDMAN_MODE=createdvd \ 36 | -v "$(pwd)/isofiles/:/tmp/images/:rw" \ 37 | -it marctv/chd-converter 38 | ``` 39 | 40 | ## check existing CHD files 41 | 42 | ```bash 43 | docker run --rm \ 44 | -v "/volume1/base/chdmaker:/tmp/images/:rw" \ 45 | --entrypoint chdman \ 46 | -it marctv/chd-converter \ 47 | info -i "WipEout Pure (USA) (En,Fr,Es) (v2.00)-60fps patch.chd" 48 | ``` -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:trixie-slim 2 | 3 | # Install modern MAME tools (includes a recent chdman with `createdvd` support) 4 | RUN apt-get update && \ 5 | apt-get upgrade -y && \ 6 | apt-get install -y --no-install-recommends \ 7 | mame-tools \ 8 | bash && \ 9 | apt-get clean && \ 10 | rm -rf /var/lib/apt/lists/* 11 | 12 | # Directory where your images will be mounted 13 | WORKDIR /tmp/images 14 | 15 | # Use bash for the ENTRYPOINT script 16 | SHELL ["/bin/bash", "-c"] 17 | 18 | # Default mode: createcd (can be overridden at runtime) 19 | ENV CHDMAN_MODE=createcd 20 | 21 | # Convert all supported image files to .chd 22 | ENTRYPOINT \ 23 | mode="${CHDMAN_MODE:-createcd}"; \ 24 | case "$mode" in \ 25 | cd) mode="createcd" ;; \ 26 | dvd) mode="createdvd" ;; \ 27 | createcd|createdvd) ;; \ 28 | *) echo "Unsupported CHDMAN_MODE: '$mode'. Use 'createcd' or 'createdvd'." >&2; exit 1 ;; \ 29 | esac; \ 30 | shopt -s nullglob; \ 31 | for i in *.gdi *.iso *.cue; do \ 32 | [[ -e "$i" ]] || continue; \ 33 | [[ -e "${i%.*}.chd" ]] && { \ 34 | echo "Skipping '$i' (CHD already exists)."; \ 35 | continue; \ 36 | }; \ 37 | echo "Converting '$i' using chdman ${mode} ..."; \ 38 | if [[ "$mode" == "createdvd" ]]; then \ 39 | chdman createdvd -hs 2048 -f -i "$i" -o "${i%.*}.chd"; \ 40 | else \ 41 | chdman createcd -f -i "$i" -o "${i%.*}.chd"; \ 42 | fi; \ 43 | done -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Build and push 2 | 3 | on: 4 | push: 5 | branches: [ "latest" ] 6 | tags: ["v*"] 7 | 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | 11 | jobs: 12 | push_to_registries: 13 | name: Push Docker image to multiple registries 14 | runs-on: ubuntu-latest 15 | permissions: 16 | packages: write 17 | contents: read 18 | steps: 19 | - name: Check out the repo 20 | uses: actions/checkout@v3 21 | - name: Set up QEMU 22 | uses: docker/setup-qemu-action@v2 23 | - name: Set up Docker Buildx 24 | uses: docker/setup-buildx-action@v2 25 | - name: Log in to Docker Hub 26 | uses: docker/login-action@v2 27 | with: 28 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 29 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 30 | 31 | - name: Log in to the Container registry 32 | uses: docker/login-action@v2 33 | with: 34 | registry: ghcr.io 35 | username: ${{ github.actor }} 36 | password: ${{ secrets.GITHUB_TOKEN }} 37 | 38 | - name: Extract metadata (tags, labels) for Docker 39 | id: meta 40 | uses: docker/metadata-action@v4 41 | with: 42 | images: | 43 | marctv/chd-converter 44 | ghcr.io/${{ github.repository }} 45 | tags: | 46 | type=ref,event=branch 47 | type=semver,pattern={{version}} 48 | 49 | - name: Build and push Docker images 50 | uses: docker/build-push-action@v4 51 | with: 52 | context: . 53 | push: true 54 | platforms: linux/amd64,linux/arm64 55 | tags: ${{ steps.meta.outputs.tags }} 56 | labels: ${{ steps.meta.outputs.labels }} 57 | - name: Update Readme.md and description 58 | uses: meeDamian/sync-readme@v1.0.6 59 | continue-on-error: true 60 | with: 61 | user: ${{ secrets.DOCKER_HUB_USERNAME }} 62 | pass: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 63 | readme: ./README.md 64 | slug: marctv/chd-converter --------------------------------------------------------------------------------