devcontainers / devcontainers/images

Missing apt public key in some Linux distros (but not all)?

Open
#1,233 7 comments 0 reactions 0 assignees View on GitHub
needs-more-info
Dominant language
Shell
Stars
2.1k
Forks
963
Avg merge
7h 48m
Merged PRs (30d)
11

Description

For my dev environment I need to install openOCD and gbd-multiarch on a Debian image.

I started by running the following docker file which works in bullseye, but does not work in bookworm. Since I needed versions of the package (specifically openOCD I needed at least version 0.12 or higher, but bullseye only goes up to 0.11), I changed it to bookworm. However it didn't work on bookworm, for some reason there is a missing public key. Finding it odd, I then changed distros to ubuntu and used the noble version because I didn't want to solve the public key issue (because I know it can rotate regularly). I then also found that I couldn't install it with noble either.

I am really scratching my head on this, because bullseye installs things just fine (even if they aren't the version I need). But when I try to go to these newer versions, even switching to a different distro, I'm wondering if I'm just getting really unlucky with finding images where the public key isn't installed correctly or if I'm doing something wrong.

I'm pretty sure this has to be a bug tho

```dockerfile

FROM mcr.microsoft.com/devcontainers/base:bookworm

# Install apt packages
RUN apt-get update \
&& apt-get install -y \
# To get SWD working, need to have the following installed in the container
openocd \
gdb-multiarch
```

Broken output preventing me from completing the build:

```
> [dev_container_auto_added_stage_label 2/2] RUN apt-get update && apt-get
install -y openocd gdb-multiarch:
#6 0.594 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#6 0.715 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
#6 0.773 Err:1 http://deb.debian.org/debian bookworm InRelease
#6 0.773 The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKE
Y F8D2585B8783D481
#6 0.775 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease
[48.0 kB]
#6 0.820 Err:2 http://deb.debian.org/debian bookworm-updates InRelease
#6 0.820 The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
#6 0.867 Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
#6 0.867 The following signatures couldn't be verified because the public key
is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
#6 0.869 Reading package lists...
#6 0.880 W: GPG error: http://deb.debian.org/debian bookworm InRelease: The foll
owing signatures couldn't be verified because the public key is not available: N
O_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
#6 0.880 E: The repository 'http://deb.debian.org/debian bookworm InRelease' is
not signed.
#6 0.880 W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease:
The following signatures couldn't be verified because the public key is not avai
lable: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
#6 0.880 E: The repository 'http://deb.debian.org/debian bookworm-updates InRele
ase' is not signed.
#6 0.880 W: GPG error: http://deb.debian.org/debian-security bookworm-security I
nRelease: The following signatures couldn't be verified because the public key i
s not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
#6 0.880 E: The repository 'http://deb.debian.org/debian-security bookworm-secur
ity InRelease' is not signed.
#6 0.880 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache
/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin |
| true'
#6 0.880 E: Sub-process returned an error code
```

Noble also doesn't work

```dockerfile
FROM mcr.microsoft.com/devcontainers/base:noble

# Install apt packages
RUN apt-get update \
&& apt-get install -y \
# To get SWD working, need to have the following installed in the container
openocd \
gdb-multiarch

```

But for some reason, the bullseye image seems to have the public key 🤷‍♂️

```dockerfile

FROM mcr.microsoft.com/devcontainers/base:bullseye

# Install apt packages
RUN apt-get update \
&& apt-get install -y \
# To get SWD working, need to have the following installed in the container
openocd \
gdb-multiarch
```

Can I please be advised what is happening here?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.