Replies: 7 comments
-
|
I've been trying to do something along these line too, also without success. We have to protect the IP of the tools that we use, which is why having a publicly accessible docker image is not feasible. Creating an internal docker container works great, however consuming that container as part of an internal action is where I'm getting stuck. I'm sure that other developers, within enterprise organisations, must have wanted to use actions in just this way. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I'd be glad to help you create custom Docker actions using private/internal images within GitHub Actions. While directly referencing private images in the workflow YAML can be challenging due to security concerns, there are effective workarounds: Method 1: Using a Docker Registry Secret Create a Docker Registry Secret: Go to your GitHub repository's settings. In your custom action's workflow YAML, define environment variables to store the username and password retrieved from the secret:
Use the custom action in your workflow, specifying the public Docker image (docker:stable-alpine) and referencing the previously defined secret: Create a Custom Docker Registry Login Action: If your use case allows it, you can create a separate action that logs in to the private registry using a dedicated service account or token. This action should be kept private within your organization. In your custom action's workflow YAML, include the login action as a step before running the private image:
args:
Additional Considerations: Choose the method that best suits your security requirements and access control constraints. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
There is still no resolution for this? Trying to do the same thing without any success. 😞 Using an image from GHCR, not DockerHub. It's in the same repo as the action, but can't access it at all. |
Beta Was this translation helpful? Give feedback.
-
|
Something doesn't make sense..... even this does not work: - name: Create Docker credentials for GHCR
id: docker_auth
env:
USER: ${{ github.actor }}
PASS: ${{ secrets.GITHUB_TOKEN }}
run: |
CREDS='{"auths": {"ghcr.io": {"auth": "'$(echo -n "$USER:$PASS" | base64)'"}}}'
echo "config=$CREDS" >> "$GITHUB_OUTPUT"
shell: bash
- name: Test docker
run: docker pull ghcr.io/org/repo
shell: bash
env:
DOCKER_AUTH_CONFIG: ${{ steps.docker_auth.outputs.config }}Still returns Same issue here: |
Beta Was this translation helpful? Give feedback.
-
|
I found a workaround! Pulling the image ahead of time allows it to then be used by the following steps/actions without requiring auth! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
Hi All,
I am trying to create new custom docker actions using the private/internal docker image but I am getting unauthorized. Is it even possible to do this?
I even tried to login to the registry before using the custom action but that didn't work too.
Beta Was this translation helpful? Give feedback.
All reactions