当前位置: 代码迷 >> 综合 >> Permission denied on accessing host directory inside containers
  详细解决方案

Permission denied on accessing host directory inside containers

热度:66   发布时间:2024-01-09 20:37:18.0

Permission denied on accessing host directory inside containers

What’s going on?

Creating a container by Podman or Docker with -v option, the access to your data volume was denied.

$ mkdir -p /tmp/directory
$ podman run -itd --name test -v /tmp/directory/:/directory:rw fedora:28 /bin/bash
$ podman exec test ls /directory
ls: cannot open directory '/directory': Permission denied
Error: exit status 2

Solutions

Because of the restriction of SELinux, you can be blocked to access the host directories from a cont

  相关解决方案