[GH-ISSUE #795] Actions Container image is misinterpreted when using own registry with short oci url #493

Closed
opened 2026-03-01 21:43:54 +03:00 by kerem · 5 comments
Owner

Originally created by @FloThinksPi on GitHub (Sep 1, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/795

Originally assigned to: @catthehacker on GitHub.

System information

  • Operating System: MacOS
  • Architecture: x64 (64-bit)
  • Apple M1: no
  • Docker version: 20.10.8
  • act version: act version 0.2.24

Expected behaviour

Pulls the correct image

Actual behaviour

Adds docker.io to the image which already has a private repo specified and thus the url is invalid.

Workflow and/or repository

workflow
jobs:
  myjob:
    runs-on: [self-hosted, linux]
    name: test job
    container:
      image: myregistry:50000/ubuntu:20.04

Steps to reproduce

Create workflow with custom container image in job step(see workflow file above).
Watch pull fail.

act output

If i just do a act without verbose i get:

[Run database tests/Run psql db tests] 🚀  Start image=myregistry:50000/ubuntu:20.04
Error: invalid reference format

So image pull URL looks fine.

However if i do act -vvv on the same workflow i get:

[Run database tests/Run psql db tests]   🐳  docker pull myregistry:50000/ubuntu:20.04
DEBU[0000] Image exists? false                          
[Run database tests/Run psql db tests] pulling image 'docker.io/myregistry:50000/ubuntu:20.04' ()
DEBU[0000] invalid reference format                     

So here one can see it puts a docker.io in front of the already complete OCI Resource URL.
Then it fails as this obviously is not allowed.

Originally created by @FloThinksPi on GitHub (Sep 1, 2021). Original GitHub issue: https://github.com/nektos/act/issues/795 Originally assigned to: @catthehacker on GitHub. ## System information - Operating System: MacOS - Architecture: x64 (64-bit) - Apple M1: no - Docker version: 20.10.8 - `act` version: act version 0.2.24 ## Expected behaviour Pulls the correct image ## Actual behaviour Adds docker.io to the image which already has a private repo specified and thus the url is invalid. ## Workflow and/or repository <details> <summary>workflow</summary> ```none jobs: myjob: runs-on: [self-hosted, linux] name: test job container: image: myregistry:50000/ubuntu:20.04 ``` </details> ## Steps to reproduce Create workflow with custom container image in job step(see workflow file above). Watch pull fail. ## `act` output If i just do a act without verbose i get: ``` [Run database tests/Run psql db tests] 🚀 Start image=myregistry:50000/ubuntu:20.04 Error: invalid reference format ``` So image pull URL looks fine. However if i do act -vvv on the same workflow i get: ``` [Run database tests/Run psql db tests] 🐳 docker pull myregistry:50000/ubuntu:20.04 DEBU[0000] Image exists? false [Run database tests/Run psql db tests] pulling image 'docker.io/myregistry:50000/ubuntu:20.04' () DEBU[0000] invalid reference format ``` So here one can see it puts a docker.io in front of the already complete OCI Resource URL. Then it fails as this obviously is not allowed.
Author
Owner

@FloThinksPi commented on GitHub (Sep 1, 2021):

It seems to work if i use:
myrepo:50000/library/ubuntu:20.04
Then the correct image is pulled.

I think act has some logic in it that interprets myrepo:50000/ubuntu:20.04 as myrepo:50000 beeing the username and ubuntu beeing the image and 20.04 beeing the tag. So it appends docker.io as registry url then.

However Docker pull on myrepo:50000/ubuntu:20.04 works as expected though and pulls the right image(which long url would be myrepo:50000/library/ubuntu:20.04). So i think it is actually wanted to pull the image that the container runtime would pull. So to interpret myrepo:50000 as url and not as username in that case.

<!-- gh-comment-id:910226081 --> @FloThinksPi commented on GitHub (Sep 1, 2021): It seems to work if i use: `myrepo:50000/library/ubuntu:20.04` Then the correct image is pulled. I think act has some logic in it that interprets `myrepo:50000/ubuntu:20.04` as `myrepo:50000` beeing the username and `ubuntu` beeing the image and `20.04` beeing the tag. So it appends docker.io as registry url then. However Docker pull on `myrepo:50000/ubuntu:20.04` works as expected though and pulls the right image(which long url would be `myrepo:50000/library/ubuntu:20.04`). So i think it is actually wanted to pull the image that the container runtime would pull. So to interpret `myrepo:50000` as url and not as username in that case.
Author
Owner

@catthehacker commented on GitHub (Sep 1, 2021):

github.com/nektos/act@6e5bd24728/pkg/container/docker_pull.go (L100-L109)

<!-- gh-comment-id:910238492 --> @catthehacker commented on GitHub (Sep 1, 2021): https://github.com/nektos/act/blob/6e5bd2472875e217b48d5abd4b103a7c20b33127/pkg/container/docker_pull.go#L100-L109
Author
Owner

@github-actions[bot] commented on GitHub (Oct 2, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:932641517 --> @github-actions[bot] commented on GitHub (Oct 2, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@catthehacker commented on GitHub (Oct 2, 2021):

Not stale, will fix that this weekend

<!-- gh-comment-id:932641921 --> @catthehacker commented on GitHub (Oct 2, 2021): Not stale, will fix that this weekend
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:956949510 --> @github-actions[bot] commented on GitHub (Nov 2, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#493
No description provided.