Closed CrazyCrud closed 4 months ago
Hi and thanks @CrazyCrud!
With which command are you starting the container? Are you really mounting some folder from the host machine into the container? If you start annif container as-is, the working directory is /annif-projects
:
docker run -it quay.io/natlibfi/annif pwd
/annif-projects
And it is owned by annif_user:
docker run -it quay.io/natlibfi/annif ls -la
total 8
drwxr-xr-x 1 annif_user annif_user 4096 Aug 10 2023 .
drwxr-xr-x 1 root root 4096 Feb 21 08:51 ..
The /usr
folder should be irrelevant for using annif.
When you need to mount some folder to the container, which you probably will need when training projects, the best approach is to make the user in the container the same as on host with the -u
option. See the Annif Wiki page:
docker run \
-v ~/annif-projects:/annif-projects \
-u $(id -u):$(id -g) \
-it quay.io/natlibfi/annif bash
You could also check Annif-tutorial excercise about using Annif with Docker.
@juhoinkinen thank you very much! It works now and the permissions are correctly set. I think the -u
option did the trick.
Thank you & best regards Constantin
Good you got it working!
Hello,
many thanks for the great work to Annif!
I have initialised the Docker container, but I can't execute commands like
annif list-projects
orannif list-vocabs
in the container itself because the permissions are missing.All files in the mounted directory as well as the
/usr/
folder belong to theroot
user. The Dockerfile states that the current user as well as the files should instead belong to theannif_user
, but it doesn't seem this way.Can you recommend any steps I could take?
Many thanks in advance!
Best regards Constantin