mgm3746 / garbagecat

Parses Java garbage collection logging and analyzes collectors, safepoint triggers, JVM version, JVM options, and OS information and reports error/warn/info level analysis and recommendations to support JVM tuning and troubleshooting for OpenJDK derivatives: (e.g. Adoptium, Azul, Microsoft, Oracle, Red Hat, etc.).
https://github.com/mgm3746/garbagecat/wiki
Eclipse Public License 1.0
211 stars 50 forks source link

Unable to access files when running in a container #172

Closed mgm3746 closed 2 years ago

mgm3746 commented 2 years ago

The container build used to work, but after restarting my system, it's unable to access the files mounted under /home/garbagecat/files/.

I build like this: $ docker build . --file Dockerfile --tag mgm:garbagecat

I run like this: $ docker run -v "$PWD":/home/garbagecat/files:z localhost/mgm:garbagecat -t 20 -p -c /home/garbagecat/files/gc.log > gc.log.cat

gc.log.cat has this: Invalid log file: '/home/garbagecat/files/gc.log.20220705125711'

If I log into the container, it looks like I'm lacking some permissions to access the files.

$ docker run -it -v "$PWD":/home/garbagecat/files:z --entrypoint sh localhost/mgm:garbagecat $ ls -al files ls: cannot access 'files/.': Permission denied ls: cannot access 'files/..': Permission denied ls: cannot access 'files/gc.log': Permission denied ls: cannot access 'files/gc.log.cat': Permission denied total 0 d????????? ? ? ? ? ? . d????????? ? ? ? ? ? .. -????????? ? ? ? ? ? gc.log -????????? ? ? ? ? ? gc.log.cat

mgm3746 commented 2 years ago

The issue is specific to the directory I'm mounting (PWD).

$ ls -al drwxr--r--. 2 mmillson mmillson 129 Jul 7 07:39 mydir

Docker/podman needs world execute permissions: $ chmod 755 mydir