Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while mounting host directory in Nexus Docker

Tags:

docker

nexus3

I am using the following command to run my container

docker run -d -p 9001:8081 --name nexus -v /Users/user.name/dockerVolume/nexus:/nexus-data sonatype/nexus3

Container starts and fail immediately. with the following logs

mkdir: cannot create directory '../sonatype-work/nexus3/log': Permission denied

mkdir: cannot create directory '../sonatype-work/nexus3/tmp': Permission denied

Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file ../sonatype-work/nexus3/log/jvm.log due to No such file or directory

I was following this link to set it up I have given said permission to nexus directory.

I also tried the following SO link but that didn't help me either. I was still getting the same error.

Docker Version 17.12.0-ce-mac47 (21805)

[EDIT] I did made changes to the ownership of my nexus folder on my host

sudo chown -R 200 ~/dockerVolume/nexus
like image 497
Anunay Avatar asked Nov 30 '22 08:11

Anunay


1 Answers

In my ubuntu server I had to perform:

chown -R 200:200 path/to/directory

Not only 200, but 200:200

like image 153
4lberto Avatar answered Dec 05 '22 08:12

4lberto