[GH-ISSUE #1633] Using -P platform with local image #811

Open
opened 2026-03-01 21:46:35 +03:00 by kerem · 9 comments
Owner

Originally created by @dannystaple on GitHub (Feb 18, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1633

Act version

0.2.42

Feature description

I would like to be able to use a local image for the -P flag.
For example:

act --eventpath myevent.json \
  -P ubuntu-latest=my-local-latest

The intent would be to take the medium image and add other parts I might need, for example the python components if the intent is to test pipelines around the python ecosystem.

Currently running this, it will force pull from a remote on dockerhub, however, this may simply be a local image that I do not intend to put onto dockerhub.

Originally created by @dannystaple on GitHub (Feb 18, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1633 ### Act version 0.2.42 ### Feature description I would like to be able to use a local image for the `-P` flag. For example: ``` act --eventpath myevent.json \ -P ubuntu-latest=my-local-latest ``` The intent would be to take the medium image and add other parts I might need, for example the python components if the intent is to test pipelines around the python ecosystem. Currently running this, it will force pull from a remote on dockerhub, however, this may simply be a local image that I do not intend to put onto dockerhub.
Author
Owner

@ChristopherHX commented on GitHub (Feb 18, 2023):

Use --pull=false. The reason that this flag now defaults to true is a breaking change in act with older default docker images.

You have to manually keep uptodate, if you use this flag.

<!-- gh-comment-id:1435718418 --> @ChristopherHX commented on GitHub (Feb 18, 2023): Use `--pull=false`. The reason that this flag now defaults to true is a breaking change in act with older default docker images. You have to manually keep uptodate, if you use this flag.
Author
Owner

@dannystaple commented on GitHub (Feb 18, 2023):

Worked a treat - just updating the docs to reflect that.

<!-- gh-comment-id:1435726672 --> @dannystaple commented on GitHub (Feb 18, 2023): Worked a treat - just updating the docs to reflect that.
Author
Owner

@joanrodriguez commented on GitHub (Feb 21, 2023):

Hey, the flag doesn't work for me if I never uploaded the image to Docker Hub....

Steps to reproduce:

  • Create Docker image locally and give repository name (foobar/docker-github-actions-runner)
  • Run this:
    act --container-architecture linux/arm64/v8
    --pull=false
    -P ubuntu-latest=foobar/docker-github-actions-runner
    -P self-hosted=foobar/docker-github-actions-runner
    

Returns: Error: Error response from daemon: pull access denied for foobar/docker-github-actions-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Do I make a mistake with the flags or the feature doesn't exist?

<!-- gh-comment-id:1438881620 --> @joanrodriguez commented on GitHub (Feb 21, 2023): Hey, the flag doesn't work for me if I never uploaded the image to Docker Hub.... Steps to reproduce: - Create Docker image locally and give repository name (foobar/docker-github-actions-runner) - Run this: ``` act --container-architecture linux/arm64/v8 --pull=false -P ubuntu-latest=foobar/docker-github-actions-runner -P self-hosted=foobar/docker-github-actions-runner ``` Returns: `Error: Error response from daemon: pull access denied for foobar/docker-github-actions-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied` Do I make a mistake with the flags or the feature doesn't exist?
Author
Owner

@ChristopherHX commented on GitHub (Feb 21, 2023):

I cannot reproduce your error.
You should see forcePull=false in the log and if act finds you image it will use it.

forcePull=true will always pull the image (--pull)
forcePull=false will pull the image if missing (--pull=false)

<!-- gh-comment-id:1438911447 --> @ChristopherHX commented on GitHub (Feb 21, 2023): I cannot reproduce your error. You should see forcePull=false in the log and if act finds you image it will use it. forcePull=true will always pull the image (--pull) forcePull=false will pull the image if missing (--pull=false)
Author
Owner

@dannystaple commented on GitHub (Feb 21, 2023):

@joanrodriguez I take it the line continuation characters are not posted just for aesthetics or that this was all on one line?
Can you show the docker image in docker list. It isn't looking for a local arm64 image when you have a x86 image is it?

<!-- gh-comment-id:1438921013 --> @dannystaple commented on GitHub (Feb 21, 2023): @joanrodriguez I take it the line continuation characters are not posted just for aesthetics or that this was all on one line? Can you show the docker image in docker list. It isn't looking for a local arm64 image when you have a x86 image is it?
Author
Owner

@joanrodriguez commented on GitHub (Feb 22, 2023):

Hey guys, I had some conflicting stuff in my .~/.actrc. After emptying it and removing the architecture arg, I'm able to use a local docker image :)

$ docker images
REPOSITORY                                    TAG                        IMAGE ID       CREATED         SIZE
spingwun/docker-github-actions-runner         latest                     a8ed893ffe96   16 hours ago    1.83GB
$ act --pull=false -P ubuntu-latest=spingwun/docker-github-actions-runner -P self-hosted=spingwun/docker-github-actions-runner
WARN  ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠  
[main/checks] 🚀  Start image=spingwun/docker-github-actions-runner
[main/db    ] 🚀  Start image=spingwun/docker-github-actions-runner
[main/build ] 🚀  Start image=spingwun/docker-github-actions-runner
[main/build ]   🐳  docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false
[main/db    ]   🐳  docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false
[main/checks]   🐳  docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false
[main/db    ]   🐳  docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main/db    ]   🐳  docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main/checks]   🐳  docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main/build ]   🐳  docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main/checks]   🐳  docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[main/build ]   🐳  docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]

You can't really tell that it didn't pull it from the logs but it was instantaneous and I had deleted the Docker image from the hub so it definitely worked :)

Thanks again

<!-- gh-comment-id:1439755849 --> @joanrodriguez commented on GitHub (Feb 22, 2023): Hey guys, I had some conflicting stuff in my `.~/.actrc`. After emptying it and removing the architecture arg, I'm able to use a local docker image :) ```sh $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE spingwun/docker-github-actions-runner latest a8ed893ffe96 16 hours ago 1.83GB $ act --pull=false -P ubuntu-latest=spingwun/docker-github-actions-runner -P self-hosted=spingwun/docker-github-actions-runner WARN ⚠ You are using Apple M1 chip and you have not specified container architecture, you might encounter issues while running act. If so, try running it with '--container-architecture linux/amd64'. ⚠ [main/checks] 🚀 Start image=spingwun/docker-github-actions-runner [main/db ] 🚀 Start image=spingwun/docker-github-actions-runner [main/build ] 🚀 Start image=spingwun/docker-github-actions-runner [main/build ] 🐳 docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false [main/db ] 🐳 docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false [main/checks] 🐳 docker pull image=spingwun/docker-github-actions-runner platform= username= forcePull=false [main/db ] 🐳 docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main/db ] 🐳 docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main/checks] 🐳 docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main/build ] 🐳 docker create image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main/checks] 🐳 docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [main/build ] 🐳 docker run image=spingwun/docker-github-actions-runner platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] ``` You can't really tell that it didn't pull it from the logs but it was instantaneous and I had deleted the Docker image from the hub so it definitely worked :) Thanks again
Author
Owner

@thomashutcheson-msm commented on GitHub (Feb 27, 2023):

Hey, the flag doesn't work for me if I never uploaded the image to Docker Hub....

Steps to reproduce:

  • Create Docker image locally and give repository name (foobar/docker-github-actions-runner)
  • Run this:
    act --container-architecture linux/arm64/v8
    --pull=false
    -P ubuntu-latest=foobar/docker-github-actions-runner
    -P self-hosted=foobar/docker-github-actions-runner
    

Returns: Error: Error response from daemon: pull access denied for foobar/docker-github-actions-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Do I make a mistake with the flags or the feature doesn't exist?

I was getting this error too, then realised I needed to add the tag as well as repository name.
my-self-hosted-image:v1
now I can run
act -j my_github_workflow -P self-hosted=my-self-hosted-image:v1 --pull=false

<!-- gh-comment-id:1446202190 --> @thomashutcheson-msm commented on GitHub (Feb 27, 2023): > Hey, the flag doesn't work for me if I never uploaded the image to Docker Hub.... > > Steps to reproduce: > > * Create Docker image locally and give repository name (foobar/docker-github-actions-runner) > * Run this: > ``` > act --container-architecture linux/arm64/v8 > --pull=false > -P ubuntu-latest=foobar/docker-github-actions-runner > -P self-hosted=foobar/docker-github-actions-runner > ``` > > Returns: `Error: Error response from daemon: pull access denied for foobar/docker-github-actions-runner, repository does not exist or may require 'docker login': denied: requested access to the resource is denied` > > Do I make a mistake with the flags or the feature doesn't exist? I was getting this error too, then realised I needed to add the tag as well as repository name. `my-self-hosted-image:v1` now I can run `act -j my_github_workflow -P self-hosted=my-self-hosted-image:v1 --pull=false`
Author
Owner

@dgrebb commented on GitHub (Jun 19, 2023):

The only question that wasn't answered here, which ended up being the issue for me:

act --container-architecture linux/amd64 --pull=false -P ubuntu-latest=custom-image-name:latest ...

This will look for that image in the specific architecture.

If your custom image wasn't build with that architecture, act will then attempt to pull an image from the registry, even with the --pull=false flag set.

@dannystaple this issue and your subsequent comment saved me days of banging my head against a wall. Thank you!

@joanrodriguez I take it the line continuation characters are not posted just for aesthetics or that this was all on one line? Can you show the docker image in docker list. It isn't looking for a local arm64 image when you have a x86 image is it?

I needed to docker buildx build --platform linux/amd64 my custom image.

<!-- gh-comment-id:1596405635 --> @dgrebb commented on GitHub (Jun 19, 2023): The only question that wasn't answered here, which ended up being the issue for me: `act --container-architecture linux/amd64 --pull=false -P ubuntu-latest=custom-image-name:latest ...` This will look for that image in the specific architecture. If your custom image wasn't build with that architecture, `act` will then attempt to pull an image from the registry, even with the `--pull=false` flag set. @dannystaple this issue and your subsequent comment saved me days of banging my head against a wall. Thank you! > @joanrodriguez I take it the line continuation characters are not posted just for aesthetics or that this was all on one line? Can you show the docker image in docker list. It isn't looking for a local arm64 image when you have a x86 image is it? I needed to `docker buildx build --platform linux/amd64` my custom image.
Author
Owner

@surgiie commented on GitHub (Aug 7, 2024):

--pull=false doesnt work with me.

[deployment/Deployment/build-and-deploy]   🐳  docker pull image=self-hosted-workers-prod:latest platform= username= forcePull=false
[deployment/Deployment/build-and-deploy] [DEBUG]   🐳  docker pull self-hosted-workers-prod:latest
[deployment/Deployment/build-and-deploy] [DEBUG] Image exists? false
[deployment/Deployment/build-and-deploy] [DEBUG] pulling image 'docker.io/library/self-hosted-workers-prod:latest' ()
Error: Error response from daemon: pull access denied for self-hosted-workers-prod, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

Im building image with --platform linux/amd64 as suggested above but its still trying to pull.

Im also able to run a container with said image:

docker run -it self-hosted-workers-prod:latest /bin/bash

Feels like my flag is being ignored. Using act version : 0.2.65

Any one have the same issue?

<!-- gh-comment-id:2274416678 --> @surgiie commented on GitHub (Aug 7, 2024): `--pull=false` doesnt work with me. ``` [deployment/Deployment/build-and-deploy] 🐳 docker pull image=self-hosted-workers-prod:latest platform= username= forcePull=false [deployment/Deployment/build-and-deploy] [DEBUG] 🐳 docker pull self-hosted-workers-prod:latest [deployment/Deployment/build-and-deploy] [DEBUG] Image exists? false [deployment/Deployment/build-and-deploy] [DEBUG] pulling image 'docker.io/library/self-hosted-workers-prod:latest' () Error: Error response from daemon: pull access denied for self-hosted-workers-prod, repository does not exist or may require 'docker login': denied: requested access to the resource is denied ``` Im building image with `--platform linux/amd64` as suggested above but its still trying to pull. Im also able to run a container with said image: `docker run -it self-hosted-workers-prod:latest /bin/bash` Feels like my flag is being ignored. Using act version : `0.2.65` Any one have the same issue?
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#811
No description provided.