0

I've recup the nexus-data folders where they are all my modification, I tried to build it with

FROM sonatype/nexus3:3.22.0

USER root:0
RUN rm -Rf ./nexus-data/*
COPY ./nexus-data ./nexus-data

RUN chown -R 200:200 ${NEXUS_HOME} ${NEXUS_DATA} ${SONATYPE_WORK}
EXPOSE 8081
USER nexus:200

and when i build it with docker build -t nexus . and run it with docker run -tti --rm -p 91:8081 nexus:latest

I've got this issue

OpenJDK 64-Bit Server VM warning: Cannot open file ../sonatype-work/nexus3/log/jvm.log due to Permission denied

Warning:  Cannot open log file: ../sonatype-work/nexus3/log/jvm.log
Warning:  Forcing option -XX:LogFile=/tmp/jvm.log
java.io.FileNotFoundException: ../sonatype-work/nexus3/tmp/i4j_ZTDnGON8hezynsMX2ZCYAVDtQog=.lock (Permission denied)
        at java.io.RandomAccessFile.open0(Native Method)
        at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
        at com.install4j.runtime.launcher.util.SingleInstance.check(SingleInstance.java:72)
        at com.install4j.runtime.launcher.util.SingleInstance.checkForCurrentLauncher(SingleInstance.java:31)
        at com.install4j.runtime.launcher.UnixLauncher.checkSingleInstance(UnixLauncher.java:88)
        at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:67)
Unable to delete file: /nexus-data/cache/bundle233/version0.0/revision.location
Unable to update instance pid: /nexus-data/instances/instance.properties (Permission denied)
Exception in thread "Thread-2" java.lang.SecurityException: Could not lock User prefs. Lock file access denied.
        at java.util.prefs.FileSystemPreferences.checkLockFile0ErrorCode(FileSystemPreferences.java:949)
        at java.util.prefs.FileSystemPreferences.lockFile(FileSystemPreferences.java:937)
        at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:741)
        at java.util.prefs.FileSystemPreferences.flush(FileSystemPreferences.java:836)
        at java.util.prefs.FileSystemPreferences.syncWorld(FileSystemPreferences.java:476)
        at java.util.prefs.FileSystemPreferences.access$1200(FileSystemPreferences.java:50)
        at java.util.prefs.FileSystemPreferences$4$1.run(FileSystemPreferences.java:454)

When I move my data into another folder in the container create, I can launch it, and when I compare the permissions they have the same.

Any help?

Gregg
  • 629
  • 5
  • 17
azrael
  • 13
  • 3
  • 1
    can you show us the permissions of that file and which user is running the process ? – invad0r Apr 17 '20 at 12:54
  • the user running it is nexus and the file instances.properties has the permissions 644 nexus:nexus, and for the jvm.logs has the same – azrael Apr 17 '20 at 13:10

0 Answers0