# Issues with building Custom Ray Docker image

**URL:** <https://discuss.ray.io/t/issues-with-building-custom-ray-docker-image/23311>\
**Category:** Uncategorized\
**Created:** [November 10, 2025, 10:58am UTC](https://discuss.ray.io/t/issues-with-building-custom-ray-docker-image/23311 "2025-11-10T10:58:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bln\_prasad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/bln_prasad/32/8328_2.png) [@bln\_prasad](https://discuss.ray.io/u/bln_prasad)\
**Post date:** [November 10, 2025, 10:58am UTC](https://discuss.ray.io/t/issues-with-building-custom-ray-docker-image/23311/1 "2025-11-10T10:58:37Z")

</div>

I’m trying to build custom docker image using FROM rayproject/ray:2.45.0-py310-gpu and it fails with below error when it runs command apt-get update due to missing correct key.

The following signatures couldn’t be verified because the public key is not available: NO\_PUBKEY 871920D1991BC93C

I tried suggestions from internet to add this key but not able to get it working using gpg. this must be basic and must be faced by other too. can you please give me steps to solve same.

Thanks,

BLN

---

<div class="post-metadata">

**Author:** ![RunLLM](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/runllm/32/8249_2.png) [@RunLLM](https://discuss.ray.io/u/RunLLM)\
**Post date:** [November 10, 2025, 10:59am UTC](https://discuss.ray.io/t/issues-with-building-custom-ray-docker-image/23311/2 "2025-11-10T10:59:04Z")

</div>

This error occurs because the public key required to verify a repository (often for Docker or CUDA) is missing in your image. The recommended solution is to fetch the missing GPG key and add it to your system’s keyring, using the modern approach (not apt-key, which is deprecated). For example, to add a key for Docker, you can use:

```bash
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

```

Then, update your sources list to reference the keyring with the `signed-by` option. This approach is shown in the official Ray Dockerfiles and PRs, and is the current best practice for resolving GPG key issues during `apt-get update` in Docker builds. See the detailed example in [this Ray PR comment](https://github.com/ray-project/ray/pull/54487) and [Ray’s base.gpu.Dockerfile](https://github.com/ray-project/ray/blob//ci/docker/base.gpu.Dockerfile).

Would you like a step-by-step breakdown for your specific image and repository?

Sources:

- [Ray PR #54487](https://github.com/ray-project/ray/pull/54487)
- [Ray’s base.gpu.Dockerfile](https://github.com/ray-project/ray/blob//ci/docker/base.gpu.Dockerfile)

Hint: Mention @RunLLM in the post for followups.

---

<div class="post-metadata">

**Author:** ![bln\_prasad](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/bln_prasad/32/8328_2.png) [@bln\_prasad](https://discuss.ray.io/u/bln_prasad)\
**Post date:** [November 10, 2025, 11:25am UTC](https://discuss.ray.io/t/issues-with-building-custom-ray-docker-image/23311/3 "2025-11-10T11:25:09Z")

</div>

Thank you for quick help. it worked.
