Github Actions Docker login #25520
-
I’m trying to push to docker.pkg.github.com from a GitHub action. Here is the login step, which fails with 401 error:
Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments
-
I’m not sure that |
Beta Was this translation helpful? Give feedback.
-
I recently tried doing something similar. It seems that the I generated a personal access token and added a repository encrypted secret to login. I’m also using the included Docker baked into the virtual image.
|
Beta Was this translation helpful? Give feedback.
-
I can’t really log What am I supposed to set the docker registry login when pushing to the GitHub registry? If I have to manually create a personal access token (which I’m actually doing at the moment), that kinda defeats the whole purpose of using an integrated environment. Why is there a GITHUB_TOKEN secret then in the CI environment? Also, there is a table in the documentation that says the GITHUB_TOKEN secret is a token with write permissions to packages: https://help.github.com/en/articles/virtual-environments-for-github-actions#token-permissions Is that not correct then? |
Beta Was this translation helpful? Give feedback.
-
I came to the same conclusion and did the same thing, but I think that’s quite a huge fail. If I want to use GitHub for CI and packages, I expect these services to be integrated. I kinda thought that was the value proposition in the first place: you can do everything in one place. Otherwise both GitHub Actions and GitHub Packages are “Yet Another Service”. |
Beta Was this translation helpful? Give feedback.
-
Tried to do the same thing to get Actions creating Docker images locally - in the hope that having images stored in GitHub might be faster than having to fetch from Docker Hub. However currently it feels like two different beta products aren’t quite ready for each other. |
Beta Was this translation helpful? Give feedback.
-
Yesterday I’ve tried to run No idea why :slight_smile: I hope this will be fixed when “GitHub actions” leaves the beta stage |
Beta Was this translation helpful? Give feedback.
-
Same problem. This documentation about this is really weak 😦 |
Beta Was this translation helpful? Give feedback.
-
Struggling with the exact same thing now. One of the unique selling points for Github actions is seamless integration with other Github services - which is completely absent in this regard. Please provide a no-hassle way to utilize package registry. All the configuration needed to do this already exists in the context (username and $GITHUB_TOKEN), so no need to boilerplate it in the YAML spec. Maybe something in the lines of:
|
Beta Was this translation helpful? Give feedback.
-
Same issue. Using GITHUB_TOKEN still results in a 401 when publishing using Github Actions. |
Beta Was this translation helpful? Give feedback.
-
This is a known issue that we’re working to resolve. GITHUB_TOKEN works for publishing most types of packages (eg, npm) but not yet for all. This will work for all types of packages - including Docker - by the time GitHub Actions and GitHub Package Registry is out of beta. |
Beta Was this translation helpful? Give feedback.
-
I’ve had success with the following step:
_ Note _: The Docker image name is lowercase. The username for docker login may contain uppercase letters. Make sure to convert them to lowercase when building the image tag string. “RepoOwner” -> “repoowner”. Same goes for the repository name. Here’s a full example: https://github.com/chrispat/actions-container-service/blob/master/.github/workflows/build-and-deploy.yml |
Beta Was this translation helpful? Give feedback.
-
https://github.com/actions/docker repo is now a 404. Anyone know why? |
Beta Was this translation helpful? Give feedback.
-
It has been deprecated for some time and they finally removed it. Docker cli commands can be run directly from all the base images now so it wasn’t needed anymore. |
Beta Was this translation helpful? Give feedback.
-
According to today’s announcement, GitHub package registry will leave beta on 13 November. Does that mean this issue has been (or is close to being) resolved? |
Beta Was this translation helpful? Give feedback.
-
Can confirm that this works now. |
Beta Was this translation helpful? Give feedback.
-
When authenticating with the registry inside of GitHub Actions, do you need to provide a username along with the GITHUB_TOKEN? If so how can we do this programatically? Is there an “actions” user/actor and how can we access it? If In the same vein that we can just use the GITHUB_TOKEN, I dont want to have to use a personal account username here. Thoughts? Possible? |
Beta Was this translation helpful? Give feedback.
-
Hello stranger, It seems like you can use
Edit: Never mind. While the login actually works, it doesn’t have the permissions needed to actually install the package… |
Beta Was this translation helpful? Give feedback.
This is a known issue that we’re working to resolve. GITHUB_TOKEN works for publishing most types of packages (eg, npm) but not yet for all. This will work for all types of packages - including Docker - by the time GitHub Actions and GitHub Package Registry is out of beta.