microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.72k stars 1.41k forks source link

Github CLI Feature fails with GPG key error #1621

Closed JamesHutchisonCarta closed 1 year ago

JamesHutchisonCarta commented 1 year ago

See https://github.com/microsoft/vscode-dev-containers/issues/1615

Only making this ticket because that one was closed.

I've tried doing a clean rebuild and still see the issue.

JamesHutchisonCarta commented 1 year ago

Ok: the issue was I was testing locally and I had a cached version of the dev container base image that was missing the key. Doing docker pull mcr.microsoft.com/vscode/devcontainers/<dev container name and tag> prior to building resolved the issue.

Edit: Nevermind, I can't reproduce it succeeding so I'm not sure how it worked when I first did this.

exil0867 commented 1 year ago

github-cli feature is currently maintained at: https://github.com/devcontainers/features. And the GDP key issue should be already fixed: https://github.com/devcontainers/features/issues/132

Chuxel commented 1 year ago

Yeah GitHub's GPG expired unexpectedly, so it broke lots of people. They've since supposedly resolved it.

The upstream issue is https://github.com/cli/cli/issues/6175 if you are still running into trouble.

Chuxel commented 1 year ago

Also - for reference, this was the update we did to try to help people before the GPG key was fixed. Using the latest dev container feature as follows will do a direct download instead of apt by default.

👋 For anyone using Codespaces, Remote-Containers, or the dev container CLI, we have updated the dev container feature to prefer pulling from the latest GitHub Release instead of adding the apt repo. (see: devcontainers/features#133)

Example devcontainer.json

{
   "image": "mcr.microsoft.com/devcontainers/base:ubuntu", // Any debian-based image
   "features": {
      "ghcr.io/devcontainers/features/github-cli:1": {}
   }
}

For future reference, supplying the option installDirectlyFromGitHubRelease: false will attempt the traditional approach that adds and fetches the github-cli via apt.

{
   "image": "mcr.microsoft.com/devcontainers/base:ubuntu", // Any debian-based image
   "features": {
      "ghcr.io/devcontainers/features/github-cli:1": {
        "installDirectlyFromGitHubRelease": false
      }
   }
}