OCR-D / ocrd_all

Master repository which includes most other OCR-D repositories as submodules
MIT License
72 stars 17 forks source link

model download in Docker only allowed for root #413

Closed mikegerber closed 9 months ago

mikegerber commented 9 months ago

At https://ocr-d.de/en/models#models-and-docker, the user is instructed to docker run the resmgr with --user $(id -u). However, the user does not by default have permission to write to /models (or the underlying Docker volume).

At least for Docker, this must be run as root inside the container, leaving out the --user parameter. (For podman this would probably work, as it runs root-less.)

mikegerber commented 9 months ago

(I was a bit confused trying to understand what was going on, because the error message I got was about /usr/local/share/ocrd-resources, not /models - might be worth reconsidering the /models path, or the error reporting in case there is a symlink.)

bertsky commented 9 months ago

I transferred to ocrd_all, because this is not wrong in the documentation, only a bug in the implementation.

Basically, all we need is another chmod go+rwx /models as final RUN instruction in the Dockerfile.

(It already worked with true bind mounts, the problem only existed for named volumes.)

Mind though that already existing named volumes might have to be removed first (because they still carry the wrong permissions), i.e. docker volume rm ocrd-models.

mikegerber commented 9 months ago

Basically, all we need is another chmod go+rwx /models as final RUN instruction in the Dockerfile. Mind though that already existing named volumes might have to be removed first (because they still carry the wrong permissions), i.e. docker volume rm ocrd-models.

Are you sure the permissions carry over to a newly created named volume?

bertsky commented 9 months ago

Are you sure the permissions carry over to a newly created named volume?

Yes, they do (I just tried).