View Issue Details

IDProjectCategoryView StatusLast Update
0003679OpenFOAMBugpublic2021-07-15 12:16
Reportermasataro asai Assigned Tochris  
PrioritynormalSeveritytrivialReproducibilityalways
Status closedResolutionfixed 
PlatformGNU/LinuxOSFedoraOS Version32
Summary0003679: SELinux error in default docker command in the script http://dl.openfoam.org/docker/openfoam8-linux
DescriptionMy machine is SELinux Enforced.
With a standard setup following the tutorial, it could not run `ls` right after launch due to `ls: cannot open directory '.': Permission denied`.
The issue is caused by SELinux.
https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker

Adding :Z to every volume mounting argument in openform8-linux will fix this issue.

--- openfoam8-linux 2020-07-22 05:09:44.000000000 -0400
+++ /home/masataro/.local/bin/openfoam8-linux 2021-05-23 10:32:59.120048896 -0400
@@ -124,11 +124,11 @@
         xauth -f "$XAUTH_PATH" nmerge -
 
     DOCKER_OPTIONS="-e XAUTHORITY=$XAUTH_PATH
- -v $XAUTH_PATH:$XAUTH_PATH
+ -v $XAUTH_PATH:$XAUTH_PATH:Z
                     --net=host"
 else
     DOCKER_OPTIONS="-e XAUTHORITY=/home/openfoam/.Xauthority \
- -v $XAUTHORITY:/home/openfoam/.Xauthority"
+ -v $XAUTHORITY:/home/openfoam/.Xauthority:Z"
 fi
 
 USER_ID=$(id -u 2> /dev/null)
@@ -146,8 +146,8 @@
     --rm \
     -e DISPLAY=$DISPLAY \
     -u $USER_ID:$GROUP_ID \
- -v /tmp/.X11-unix:/tmp/.X11-unix \
- -v $MOUNT_DIR:$HOME_DIR \
+ -v /tmp/.X11-unix:/tmp/.X11-unix:Z \
+ -v $MOUNT_DIR:$HOME_DIR:Z \
     $DOCKER_OPTIONS \
     $DOCKER_IMAGE
TagsNo tags attached.

Activities

chris

2021-07-15 12:16

manager   ~0012084

Thanks for the suggestion.
The changes have been included in the openfoam8-linux script:
https://dl.openfoam.org/docker/openfoam8-linux

Issue History

Date Modified Username Field Change
2021-05-23 15:34 masataro asai New Issue
2021-07-15 12:16 chris Assigned To => chris
2021-07-15 12:16 chris Status new => closed
2021-07-15 12:16 chris Resolution open => fixed
2021-07-15 12:16 chris Note Added: 0012084