Skip to content

UID mapping works for standalone container, but fails when using a pod #24939

Answered by eriksjolund
radiojosh asked this question in Q&A
Discussion options

You must be logged in to vote

I'm able to reproduce the error message

Error: OCI runtime error: crun: mount `devpts` to `dev/pts`: Invalid argument

with this bash script that I think is more or less the same what you do

start1.sh

#!/bin/bash

set -o errexit
set -o nounset

host_uid=$(id -u)
host_gid=$(id -g)

container_uid=5050
container_gid=0

network=$1
pod=$2
port=$3
volume=$4
container=$5

password=not-a-safe-password
[email protected]

podman network create $network
podman volume create $volume

podman pod create \
     --uidmap ${container_uid}:@${host_uid}:1 \
     --uidmap 0:1:1000 \
     --gidmap ${container_gid}:@${host_gid}:1 \
     --network $network \
     --publish ${port}:80 \
     --name $pod
…

Replies: 1 comment 2 replies

Comment options

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

@eriksjolund
Comment options

Answer selected by radiojosh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants