Skip to content

Commit 047e158

Browse files
sodreknikure
authored andcommitted
fix: 🐛 Add SELinux label to local docker volumes
1 parent 93006f3 commit 047e158

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sagemaker/local/image.py

+3
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,9 @@ def __init__(self, host_dir, container_dir=None, channel=None):
887887

888888
self.container_dir = container_dir if container_dir else "/opt/ml/input/data/" + channel
889889
self.host_dir = host_dir
890+
if platform.system() == "Linux":
891+
# Support mounting volumes in SELinux enabled hosts
892+
self.container_dir += ":Z"
890893
if platform.system() == "Darwin" and host_dir.startswith("/var"):
891894
self.host_dir = os.path.join("/private", host_dir)
892895

0 commit comments

Comments
 (0)