# W: GPG error: http://deb.debian.org/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available

- **ID:** `docker/gpg-key-expired`
- **Domain:** docker
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Docker build uses a cached base image with outdated apt repository GPG keys, causing apt-get update to fail on signature verification.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 24.0.6 | active | — | — |
| Debian 11 (bullseye) | active | — | — |
| Ubuntu 22.04 | active | — | — |

## Workarounds

1. **Add --no-cache flag to force rebuild: docker build --no-cache -t my_image .** (90% success)
   ```
   Add --no-cache flag to force rebuild: docker build --no-cache -t my_image .
   ```
2. **Update the base image to latest version: RUN apt-get update && apt-get install -y --allow-unauthenticated gnupg && curl -fsSL https://deb.debian.org/debian/archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/debian-archive-keyring.gpg** (85% success)
   ```
   Update the base image to latest version: RUN apt-get update && apt-get install -y --allow-unauthenticated gnupg && curl -fsSL https://deb.debian.org/debian/archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/debian-archive-keyring.gpg
   ```

## Dead Ends

- **** — Manually importing the key in Dockerfile with apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <key> often fails because apt-key is deprecated and keyserver may be unreachable. (50% fail)
- **** — Removing the entire apt list and retrying without updating the base image still uses the same cached layer with broken keys. (80% fail)
