xetus-oss / docker-archiva

A docker image for Apache Archiva
Apache License 2.0
55 stars 33 forks source link

Permission denied: Cannot create '/archiva-data' directory when using volume option #3

Closed blankdots closed 7 years ago

blankdots commented 7 years ago

Using the command from the example:

docker run --name archiva -h archiva -p 443:8443\                 
  -e SSL_ENABLED=true -v /somepath/archiva_mnt:/archiva-data xetusoss/archiva

or

docker run --name archiva -h archiva -p 8080:8080 -v /archiva_mnt:/archiva-data xetusoss/archiva

Results in:

mkdir: cannot create directory ‘/archiva-data/temp’: Permission denied
chown: cannot access ‘/archiva-data/temp’: No such file or directory
Installing data
cp: cannot create directory ‘/archiva-data/data’: Permission denied
chown: cannot access ‘/archiva-data/data’: No such file or directory
Installing logs
cp: cannot create directory ‘/archiva-data/logs’: Permission denied
chown: cannot access ‘/archiva-data/logs’: No such file or directory
Installing repositories
mkdir: cannot create directory ‘/archiva-data/repositories’: Permission denied
chown: cannot access ‘/archiva-data/repositories’: No such file or directory
Installing conf
cp: cannot create directory ‘/archiva-data/conf’: Permission denied
chown: cannot access ‘/archiva-data/conf’: No such file or directory
Generating self-signed keystore and certificate for HTTPS support(Dst: /archiva-data/ssl/keystore)
mkdir: cannot create directory ‘/archiva-data/ssl/’: Permission denied
keytool error: java.io.FileNotFoundException: /archiva-data/ssl/keystore (No such file or directory)
mv: cannot move ‘jetty.xml’ to ‘/archiva-data/conf/jetty.xml’: No such file or directory
Running Apache Archiva...
FATAL  | wrapper  | Unable to resolve the full path of the configuration file, /opt/archiva/conf/wrapper.conf: No such file or directory

I see there is also a comment about this https://hub.docker.com/r/xetusoss/archiva/ Is there a workaround or we have to set permissions to that folder every time?

x-lhan commented 7 years ago

Thank you for the bug report. I am investigating on improving permission handling in the next commit.

blankdots commented 7 years ago

@x-lhan super, thanks!

x-lhan commented 7 years ago

e826a10 should fix this problem.