Is it possible to use private Docker Hub images? #5179
-
I'm trying to follow the instructions here, which tell you set three environment variables: I've set these:
However, when I try to run a codespaces, I get this error:
It didn't log in as my account. Steps to reproduce
.devcontainer/devcontainer.json{
"name": "test-codespaces",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
}
} .devcontainer/Dockerfile
Ensure your account has access to the private image in the previous step.
Expected: it loads the new image docker log
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
A couple of things to check.
|
Beta Was this translation helpful? Give feedback.
-
Is there any way you can enable this on all repositories? Or at least for a Dockerhub specific integration it'd be nice. I frequently find myself building Docker images in Codespaces and the only options to get them pushed to my hub account are:
It's probably not a big deal for folks that has a few repos but if you do a lot of random OSS stuff it's a minor annoyance that adds up =( |
Beta Was this translation helpful? Give feedback.
-
I'm having an issue where it says:
I already checked and verified the three secrets( it works when I set the secrets on the repo level) Some debugging on my end shows that it works when I set the secrets on the repository level, but not on the user level. Yes, access has already been granted to the repo |
Beta Was this translation helpful? Give feedback.
A couple of things to check.
First, change
registry.hub.docker.com
tohttps://index.docker.io/v1/
.Be sure the secrets you've created are assigned to the repository you'll be using them in if you set them at the user or organization level.
You may need to stop and then start the Codespace you are in for the new environment variables to be passed into the container. (F1 or Ctrl+Shift+P > Codespaces: Stop Current Codespace)