Closed Artmorse closed 3 years ago
👋 Hello!
Can you check that the directory you're mounting (/volume1/docker/archiva/data
) allows the archiva process's user/group to access it.
How you do that is dependent on the OS and docker version you're using. For most setups, it's just making sure that UID 1000
/ GID 1000
has read/write access to the directory.
It's OK !
I've added 2 environment variables (UID and GID) and it works.
docker run --name archiva -v /volume1/docker/archiva/data:/archiva/data -e UID=1026 -e GID=100 -p 62547:8080 xetusoss/archiva
Finally it doesn't work. My user have create the directory :
$ls -ltrah data
drwxrwxrwx+ 1 me users 0 Dec 14 10:45 data
$id me
uid=1026(me) gid=100(users) groups=100(users),101(administrators)
So, yesterday, I've added the variables :
But I can't create my directory ... (Permission denied)
When I do :
$chmod 777 data/
Now, my container have the good right to create files but 777 it's bad...
It seems you're bumping into confusion around file system permissions with local volume mounts. It's an easy thing to get tripped up by and has been discussed a lot (here and here, for example).
A few hints to sort it out
I would not recommend overwriting the UID/GID the archiva process runs as. That's something we've never tested.
Follow the earlier suggestion of making sure the archiva process has read/write access to the local directory
mkdir my-archiva-data
chown 1000:1000 my-archiva-data
docker run -v "${PWD}/my-archiva-data:archiva-data" --name archiva -p 8080:8080 xetusoss/archiva
If you're still struggling to get permissions sorted, just use a data volume on the host using commands like this...
# Creates a named volume that will not be removed when the container is removed.
docker volume create --name archiva-data
# Creates an archiva instance that uses the newly created data container
docker run -v archiva-data:/archiva-data --name archiva -p 8080:8080 xetusoss/archiva
or you can use the docker-compose sample in the readme, that works too.
Oh okay! Thanks a lot! :+1:
@Artmorse - Hi - Not sure if you're still experiencing this issue but I just ran into the same problem myself. First up, based on the path, I'm assuming you're using a Synology NAS. (Me too!)
The reason you're getting this is the docker container needs the permissions (at the Synology level) on the directory of the NAS. For example, In File Station, I set the directory permissions to give the system read/write access and it worked.
Right Click on the directory -> properties -> permissions tab -> add System as read / write.
I tried to lock it down further to a 1000 user, however that did not work.
Using the command :
docker run --name archiva -v /volume1/docker/archiva/data:/archiva-data -p 62547:8080 xetusoss/archiva:v2
Results in:
I see there is an old issue about the permissions : https://github.com/xetus-oss/docker-archiva/issues/3