Skip to content

開発コンテナ起動時にGPGキーエラー

cf. https://github.com/devcontainers/images/issues/1752

4.612 Reading package lists...
4.959 W: GPG error: https://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 62D54FD4003F6525
4.959 E: The repository 'https://dl.yarnpkg.com/debian stable InRelease' is not signed.
4.960 ERROR: Feature "Docker (Docker-in-Docker)" (ghcr.io/devcontainers/features/docker-in-docker) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/docker-in-docker for help troubleshooting this error.

上記エラー発生時は、開発コンテナ起動前にリポジトリを削除します:

devcontainer.json
{
  "name": "Go",
  "build": {
    "dockerfile": "Dockerfile"
  },
  "features": {
    "ghcr.io/devcontainers/features/docker-in-docker:2": {}
  },
  "customizations": {
    "vscode": {
      "settings": {
        "editor.formatOnSave": true,
        "[go]": {
          "editor.rulers": [100]
        }
      },
      "extensions": ["golang.go"]
    }
  }
}
Dockerfile
FROM mcr.microsoft.com/devcontainers/go:1.24-bookworm

# 不要なyarnリポジトリを削除
RUN rm -f /etc/apt/sources.list.d/yarn.list