cancel
Showing results for 
Search instead for 
Did you mean: 
  • 415 Views

Question on Bind Mount on host system with different user

Jump to solution

Hi,

I have a container file which will run as USER arun and also want to do a bind mount for a logs folder to a local folder. I'm not able to bind mount by below command.

podman run -d --name mycon -p 8080:8080 -v /home/student/EX188_practice/lab5/apachelog:/custom/lab/exercise/apache-tomcat-10.1.24/logs:Z myfirstimage:1.0

I can see the SELinux context is set correctly has correct access.

drwxr-xr-x. 2 student student system_u:object_r:container_file_t:s0:c254,c627 6 May 21 13:20 apachelog

Also noticed inside the container I can see the mount folder is created as root, how to overwrite this mount folder to be created for user arun?

 

Labels (3)
1 Solution

Accepted Solutions
  • 313 Views

Got the Solution to use podman unshare command to resolve the access issue.

podman unshare chown -R arun:arun foldername

this command will update the ownership so the container can access with user arun and group arun.

View solution in original post

0 Kudos
1 Reply
  • 314 Views

Got the Solution to use podman unshare command to resolve the access issue.

podman unshare chown -R arun:arun foldername

this command will update the ownership so the container can access with user arun and group arun.

0 Kudos
Join the discussion
You must log in to join this conversation.