Skip to content

Problem with uids and permissions #12970

Answered by eriksjolund
Joerg-L asked this question in Q&A
Jan 21, 2022 · 13 comments · 11 replies
Discussion options

You must be logged in to vote

@Joerg-L By using --uidmap and --gidmap the created files will be owned by your normal user.
I tried it out and it seems to work:

$ subuidSize=$(echo $(( $(podman info --format "{{ range .Host.IDMappings.UIDMap }}+{{.Size }}{{end }}" ) - 1 )))
$ subgidSize=$(echo $(( $(podman info --format "{{ range .Host.IDMappings.GIDMap }}+{{.Size }}{{end }}" ) - 1 )))
$ mkdir dir1
$ uid=2003; gid=2003; podman run --rm -v ./dir1:/var/atlassian/application-data/bitbucket:Z  --user $uid:$gid \
  --uidmap $uid:0:1 \
  --uidmap 0:1:$uid \
  --uidmap $(($uid+1)):$(($uid+1)):$(($subuidSize-$uid)) \
  --gidmap $gid:0:1 \
  --gidmap 0:1:$gid \
  --gidmap $(($gid+1)):$(($gid+1)):$(($subgidSize-$gid)) --name="bi…

Replies: 13 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jwcard
Comment options

@eriksjolund
Comment options

Answer selected by Joerg-L
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Joerg-L
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@Joerg-L
Comment options

@giuseppe
Comment options

@Joerg-L
Comment options

@rhatdan
Comment options

@Joerg-L
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature.
5 participants
Converted from issue

This discussion was converted from issue #12960 on January 21, 2022 21:52.