javadockerdocker-javaocrmypdf

ocrmypdf not working when using the docker image and the docker java client over a binding volume


When running an ocrmypdf docker container, all I get is the following message:

ocrmypdf: error: unrecognized arguments: 64ee37a6fc66cf591ce4a35f-1.png_OCR.pdf

This is what my docker inspect container shows:

        "Args": [
            "ocrmypdf",
            "--rotate-pages",
            "/64ee36779438c74174f123ea/pdf/64ee36779438c74174f123e9-1.png",
            "/64ee36779438c74174f123ea/pdf/64ee36779438c74174f123e9-1.png_OCR.pdf"
        ],
        ...
        "Binds": [
            "pdf-tools-data-volume:/64ee36779438c74174f123ea/pdf:rw"
        ],
        ...
        "Mounts": [
        {
            "Type": "volume",
            "Name": "pdf-tools-data-volume",
            "Source": "/var/lib/docker/volumes/pdf-tools-data-volume/_data",
            "Destination": "/64ee36779438c74174f123ea/pdf",
            "Driver": "local",
            "Mode": "rw",
            "RW": true,
            "Propagation": ""
        }],
        ...
        "Cmd": [
            "ocrmypdf",
            "--rotate-pages",
            "/64ee36779438c74174f123ea/pdf/64ee36779438c74174f123e9-1.png",
            "/64ee36779438c74174f123ea/pdf/64ee36779438c74174f123e9-1.png_OCR.pdf"
        ]
     

Has anyone attempted to use ocrmypdf with docker mounting volumes?


Solution

  • Ugh. After running the container through the command line I noticed I didn't need that extra ocrmypdf argument at the beginning.