#failed to pull image: failed to register layer: Container ID 1258672 cannot be mapped to a host ID

7 messages · Page 1 of 1 (latest)

tribal timber
#

I get this error when I build my containers either based on nvidia/cuda:11.8.0-runtime-ubuntu20.04 or node:22.11.0.

I build my image in github actions on runs-on: ubuntu-latest for platforms: linux/amd64.

Is this a common problem?
Are there any known solutions?

jade forum
#

Getting same error (different container id) but for pulling a custom image based on nvidia/cuda:12.8.0-devel-ubuntu22.04. Tried rebuilding the the image with USER root and creating a non-root user but both fixes failed and I got the same error. Any fixes? surprised that this hasn't been answered in 10 months

Add non-root user to a container

jade forum
faint walrus
#

use runtime instead also runpod pods run as root

jade forum
#

thanks, I've also pasted in an extract from the response team in case this helps others:

What’s happening

The error:

failed to register layer: container ID XXXXX cannot be mapped to a host ID

is a known issue when using certain nvidia/cuda:*-devel images on platforms that run containers with user namespace remapping / rootless isolation, which Runpod does.
The devel images contain files and ownership metadata that exceed the UID/GID mapping range available on the host, so the image fails during layer registration before the container even starts.

That’s why:

The image builds fine elsewhere
The error happens immediately on pull
Other users have reported the same thing with -devel bases
This is not a CUDA 12.8 issue by itself, it is specifically the devel variant.

Recommended fix
Switch your base image from devel to runtime and explicitly install only the build tools you actually need.

For example:
FROM nvidia/cuda:12.8.0-runtime-ubuntu22.04
Then add back the required packages:

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    gcc \
    g++ \
    make \
    git \
    curl \
    wget \
    sudo \
    nginx \
    && rm -rf /var/lib/apt/lists/*

In most cases, this is sufficient and avoids the UID mapping issue entirely.