[GH-ISSUE #2092] Container option --pull always is not supported #1001

Closed
opened 2026-03-01 21:48:06 +03:00 by kerem · 6 comments
Owner

Originally created by @fpfaff on GitHub (Nov 13, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2092

Bug report info

❯ gh act --bug-report
act version:            0.2.53
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/user/.actrc:
                --secret-file .act_secrets
                -P z=catthehacker/ubuntu:full-20.04
                -P ubuntu-latest=catthehacker/ubuntu:full-20.04
Build info:
        Go version:            go1.20.10
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -trimpath:            true
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         e8856f0fb00fcdd16eef2325b845f55f5d346f51
                vcs.time:             2023-08-21T16:17:06Z
                vcs.modified:         true
Docker Engine:
        Engine version:        23.0.2
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu 22.04.2 LTS
        OS type:               linux
        OS version:            22.04
        OS arch:               x86_64
        OS kernel:             5.15.0-79-generic
        OS CPU:                4
        OS memory:             7870 MB
        Security options:
                name=apparmor
                name=seccomp,profile=builtin
                name=cgroupns

Command used with act

gh act -W .github/workflows/test-pull.yml

Describe issue

GitHub actions support the container option: options: --pull always.
We use this to ensure our builds always use the latest build container.

However, running a workflow with this container option using act fails with: Error: Cannot parse container options: '--pull always': 'unknown flag: --pull'

This is probably related to how the containers are created/started

No response

Workflow content

on:
  push:

jobs:
  test:
    runs-on: [self-hosted, Linux, static ]
    container:
      image: "busybox:latest"
      options: --pull always
    
    steps:
      - run: echo just testing

Relevant log output

[test-pull.yml/test]   🐳  docker create image=busybox:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[test-pull.yml/test] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:true OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp LANG=C.UTF-8] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:busybox:latest Volumes:map[] WorkingDir:/home/user/tester-ui Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]}
[test-pull.yml/test] [DEBUG] Common container.HostConfig ==> &{Binds:[/var/run/docker.sock:/var/run/docker.sock] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode:host PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] ConsoleSize:[0 0] Annotations:map[] CapAdd:[] CapDrop:[] CgroupnsMode: DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:0 Sysctls:map[] Runtime: Isolation: Resources:{CPUShares:0 Memory:0 NanoCPUs:0 CgroupParent: BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CPURealtimePeriod:0 CPURealtimeRuntime:0 CpusetCpus: CpusetMems: Devices:[] DeviceCgroupRules:[] DeviceRequests:[] KernelMemory:0 KernelMemoryTCP:0 MemoryReservation:0 MemorySwap:0 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:<nil> Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMaximumBandwidth:0} Mounts:[{Type:volume Source:act-test-pull-yml-test-524e1861e31eda06f58dbbb7a1ae9af531d51f45d4f116c3f87b205d22810f06-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-test-pull-yml-test-524e1861e31eda06f58dbbb7a1ae9af531d51f45d4f116c3f87b205d22810f06 Target:/home/user/tester-ui ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-toolcache Target:/toolcache ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>}
Error: Cannot parse container options: '--pull always': 'unknown flag: --pull'

Additional information

No response

Originally created by @fpfaff on GitHub (Nov 13, 2023). Original GitHub issue: https://github.com/nektos/act/issues/2092 ### Bug report info ```plain text ❯ gh act --bug-report act version: 0.2.53 GOOS: linux GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/user/.actrc: --secret-file .act_secrets -P z=catthehacker/ubuntu:full-20.04 -P ubuntu-latest=catthehacker/ubuntu:full-20.04 Build info: Go version: go1.20.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -trimpath: true CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: e8856f0fb00fcdd16eef2325b845f55f5d346f51 vcs.time: 2023-08-21T16:17:06Z vcs.modified: true Docker Engine: Engine version: 23.0.2 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.04.2 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.15.0-79-generic OS CPU: 4 OS memory: 7870 MB Security options: name=apparmor name=seccomp,profile=builtin name=cgroupns ``` ### Command used with act ```sh gh act -W .github/workflows/test-pull.yml ``` ### Describe issue GitHub actions support the container option: `options: --pull always`. We use this to ensure our builds always use the latest build container. However, running a workflow with this container option using `act` fails with: `Error: Cannot parse container options: '--pull always': 'unknown flag: --pull'` This is probably related to how the containers are created/started ### Link to GitHub repository _No response_ ### Workflow content ```yml on: push: jobs: test: runs-on: [self-hosted, Linux, static ] container: image: "busybox:latest" options: --pull always steps: - run: echo just testing ``` ### Relevant log output ```sh [test-pull.yml/test] 🐳 docker create image=busybox:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host" [test-pull.yml/test] [DEBUG] Common container.Config ==> &{Hostname: Domainname: User: AttachStdin:false AttachStdout:false AttachStderr:false ExposedPorts:map[] Tty:true OpenStdin:false StdinOnce:false Env:[RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_ARCH=X64 RUNNER_TEMP=/tmp LANG=C.UTF-8] Cmd:[] Healthcheck:<nil> ArgsEscaped:false Image:busybox:latest Volumes:map[] WorkingDir:/home/user/tester-ui Entrypoint:[] NetworkDisabled:false MacAddress: OnBuild:[] Labels:map[] StopSignal: StopTimeout:<nil> Shell:[]} [test-pull.yml/test] [DEBUG] Common container.HostConfig ==> &{Binds:[/var/run/docker.sock:/var/run/docker.sock] ContainerIDFile: LogConfig:{Type: Config:map[]} NetworkMode:host PortBindings:map[] RestartPolicy:{Name: MaximumRetryCount:0} AutoRemove:false VolumeDriver: VolumesFrom:[] ConsoleSize:[0 0] Annotations:map[] CapAdd:[] CapDrop:[] CgroupnsMode: DNS:[] DNSOptions:[] DNSSearch:[] ExtraHosts:[] GroupAdd:[] IpcMode: Cgroup: Links:[] OomScoreAdj:0 PidMode: Privileged:false PublishAllPorts:false ReadonlyRootfs:false SecurityOpt:[] StorageOpt:map[] Tmpfs:map[] UTSMode: UsernsMode: ShmSize:0 Sysctls:map[] Runtime: Isolation: Resources:{CPUShares:0 Memory:0 NanoCPUs:0 CgroupParent: BlkioWeight:0 BlkioWeightDevice:[] BlkioDeviceReadBps:[] BlkioDeviceWriteBps:[] BlkioDeviceReadIOps:[] BlkioDeviceWriteIOps:[] CPUPeriod:0 CPUQuota:0 CPURealtimePeriod:0 CPURealtimeRuntime:0 CpusetCpus: CpusetMems: Devices:[] DeviceCgroupRules:[] DeviceRequests:[] KernelMemory:0 KernelMemoryTCP:0 MemoryReservation:0 MemorySwap:0 MemorySwappiness:<nil> OomKillDisable:<nil> PidsLimit:<nil> Ulimits:[] CPUCount:0 CPUPercent:0 IOMaximumIOps:0 IOMaximumBandwidth:0} Mounts:[{Type:volume Source:act-test-pull-yml-test-524e1861e31eda06f58dbbb7a1ae9af531d51f45d4f116c3f87b205d22810f06-env Target:/var/run/act ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-test-pull-yml-test-524e1861e31eda06f58dbbb7a1ae9af531d51f45d4f116c3f87b205d22810f06 Target:/home/user/tester-ui ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>} {Type:volume Source:act-toolcache Target:/toolcache ReadOnly:false Consistency: BindOptions:<nil> VolumeOptions:<nil> TmpfsOptions:<nil> ClusterOptions:<nil>}] MaskedPaths:[] ReadonlyPaths:[] Init:<nil>} Error: Cannot parse container options: '--pull always': 'unknown flag: --pull' ``` ### Additional information _No response_
kerem 2026-03-01 21:48:06 +03:00
Author
Owner

@ChristopherHX commented on GitHub (Nov 13, 2023):

We use this to ensure our builds always use the latest build container

Isn't this the default behavior of both actions/runner and act?

While actions/runner has no opt out.

actions/runner performs these steps

  • docker pull this pulls regardless if such a flag exists
  • Then something like docker run/create ... tail -f /dev/null

actions/runner directly pass options to docker cli, act doesn't use the cli interface

GitHub actions support the container option

Is this documented? I believe undocumented stuff only works, but does not mean supported.

<!-- gh-comment-id:1808678123 --> @ChristopherHX commented on GitHub (Nov 13, 2023): > We use this to ensure our builds always use the latest build container Isn't this the default behavior of both actions/runner and act? While actions/runner has no opt out. actions/runner performs these steps - docker pull this pulls regardless if such a flag exists - Then something like docker run/create ... tail -f /dev/null actions/runner directly pass options to docker cli, act doesn't use the cli interface > GitHub actions support the container option Is this documented? I believe undocumented stuff only works, but does not mean supported.
Author
Owner

@fpfaff commented on GitHub (Nov 14, 2023):

We added it because we had the issue that actions/runner did not pull the latest image.
I will investigate if this is still the case.

<!-- gh-comment-id:1810300943 --> @fpfaff commented on GitHub (Nov 14, 2023): We added it because we had the issue that `actions/runner` did not pull the latest image. I will investigate if this is still the case.
Author
Owner

@fpfaff commented on GitHub (Nov 14, 2023):

GitHub actions support the container option

Is this documented? I believe undocumented stuff only works, but does not mean supported.

The Github Actions documentation states:

Use jobs.<job_id>.container.options to configure additional Docker container resource options. For a list of options, see "docker create options."

Warning: The --network and --entrypoint options are not supported.

Given that it explicitly states the options that are not supported, I assume all others are supported.

<!-- gh-comment-id:1810312379 --> @fpfaff commented on GitHub (Nov 14, 2023): > > GitHub actions support the container option > > Is this documented? I believe undocumented stuff only works, but does not mean supported. The [Github Actions documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions) states: > Use jobs.<job_id>.container.options to configure additional Docker container resource options. For a list of options, see "[docker create options](https://docs.docker.com/engine/reference/commandline/create/#options)." > > Warning: The --network and --entrypoint options are not supported. Given that it explicitly states the options that are not supported, I assume all others are supported.
Author
Owner

@github-actions[bot] commented on GitHub (May 13, 2024):

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

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

@pavel-kalmykov commented on GitHub (Aug 10, 2024):

I have encountered the same issue when setting a container name with options: --name abc. I think https://github.com/nektos/act/issues/2412 is related to this as well.

<!-- gh-comment-id:2280744536 --> @pavel-kalmykov commented on GitHub (Aug 10, 2024): I have encountered the same issue when setting a container name with `options: --name abc`. I think https://github.com/nektos/act/issues/2412 is related to this as well.
Author
Owner

@dkowis commented on GitHub (Oct 19, 2024):

I also just run into this when I wanted to do a --pull always

<!-- gh-comment-id:2424203917 --> @dkowis commented on GitHub (Oct 19, 2024): I also just run into this when I wanted to do a `--pull always`
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#1001
No description provided.