Authenticating against Github Container Registry in Codespaces

I’m trying to use something like the following in my devcontainer.json:

 "build": {
    "dockerfile": "Dockerfile"
  },

When the Dockerfile references an image that is extends from Github Container Registry (private), I get an authentication failure.

FROM ghcr.io/<private>:<private>

...

I assumed that Codespaces sets the GITHUB_TOKEN env var by default. Do I need to do something special?

Thanks.

By following Codespaces documentation, i added three Codespaces secrets named

GHCR_CONTAINER_REGISTRY_SERVER = ghcr.io
GHCR_CONTAINER_REGISTRY_USER = <username>
GHCR_CONTAINER_REGISTRY_PASSWORD = <token>

This worked for me, however i was referencing private image from ghcr.io in devcontainer.json file directly in image field.