[GH-ISSUE #2137] Inconsistency using custom Docker image #1018

Closed
opened 2026-03-01 21:48:16 +03:00 by kerem · 1 comment
Owner

Originally created by @sockmaster27 on GitHub (Dec 20, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2137

Bug report info

act version:            0.2.52
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        \\.\pipe\docker_engine(broken)
Config files:
        C:\Users\Holger\.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.20.8
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.52 -X main.commit=44ea01c2097eaad1596f4dafd6ec84872bd00402 -X main.date=2023-10-01T02:15:30Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         44ea01c2097eaad1596f4dafd6ec84872bd00402
                vcs.time:             2023-10-01T02:15:05Z
                vcs.modified:         false
Docker Engine:
        Engine version:        24.0.6
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.133.1-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             7900 MB
        Security options:
                name=seccomp,profile=unconfined

Command used with act

act push

Describe issue

When using a custom Docker image, my tests pass locally, but not in the actual GitHub CI.

Specifically, the installation of Cargo on the image works fine when run with act, but fails in the real environment, because rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.

While I understand that the base runner environments aren't identical to the real ones, it was my understanding that using a custom image on top of that should create an entirely isolated environment. Am I misunderstanding something?

No response

Workflow content

name: Build and Test

on:
    push:
        branches: [master]
    pull_request:
        branches: [master]

env:
    CARGO_TERM_COLOR: always

jobs:
    build_and_test:
        name: Build and Test
        runs-on: ubuntu-latest
        container:
            image: <xxx>
        timeout-minutes: 10
        steps:
            - uses: actions/checkout@v4
            - name: Check with Clippy
              run: cargo clippy --all-targets --all-features -- -D warnings
            - name: Run Tests
              run: cargo test

Relevant log output

(From GitHub)

> Run cargo clippy --all-targets --all-features -- -D warnings
error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
Error: Process completed with exit code 1.

Additional information

The contents of the Dockerfile is as follows:

# Create an image containing the dependencies required for the CI pipeline

FROM ubuntu:latest

# Update apt-get index
RUN apt-get update

# Install utilities
RUN apt-get install -y curl
RUN apt-get install -y pkg-config
RUN apt-get install -y build-essential

# Install ALSA
RUN apt-get install -y libasound2-dev

# Install Rust toolchain
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
ENV PATH="/root/.cargo/bin:$PATH"
Originally created by @sockmaster27 on GitHub (Dec 20, 2023). Original GitHub issue: https://github.com/nektos/act/issues/2137 ### Bug report info ```plain text act version: 0.2.52 GOOS: windows GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is not set Sockets found: \\.\pipe\docker_engine(broken) Config files: C:\Users\Holger\.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.20.8 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.52 -X main.commit=44ea01c2097eaad1596f4dafd6ec84872bd00402 -X main.date=2023-10-01T02:15:30Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: windows GOAMD64: v1 vcs: git vcs.revision: 44ea01c2097eaad1596f4dafd6ec84872bd00402 vcs.time: 2023-10-01T02:15:05Z vcs.modified: false Docker Engine: Engine version: 24.0.6 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.15.133.1-microsoft-standard-WSL2 OS CPU: 16 OS memory: 7900 MB Security options: name=seccomp,profile=unconfined ``` ### Command used with act ```sh act push ``` ### Describe issue When using a custom Docker image, my tests pass locally, but not in the actual GitHub CI. Specifically, the installation of Cargo on the image works fine when run with act, but fails in the real environment, because `rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.` While I understand that the base runner environments aren't identical to the real ones, it was my understanding that using a custom image on top of that should create an entirely isolated environment. Am I misunderstanding something? ### Link to GitHub repository _No response_ ### Workflow content ```yml name: Build and Test on: push: branches: [master] pull_request: branches: [master] env: CARGO_TERM_COLOR: always jobs: build_and_test: name: Build and Test runs-on: ubuntu-latest container: image: <xxx> timeout-minutes: 10 steps: - uses: actions/checkout@v4 - name: Check with Clippy run: cargo clippy --all-targets --all-features -- -D warnings - name: Run Tests run: cargo test ``` ### Relevant log output ```sh (From GitHub) > Run cargo clippy --all-targets --all-features -- -D warnings error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured. help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain. Error: Process completed with exit code 1. ``` ### Additional information The contents of the Dockerfile is as follows: ``` # Create an image containing the dependencies required for the CI pipeline FROM ubuntu:latest # Update apt-get index RUN apt-get update # Install utilities RUN apt-get install -y curl RUN apt-get install -y pkg-config RUN apt-get install -y build-essential # Install ALSA RUN apt-get install -y libasound2-dev # Install Rust toolchain RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y ENV PATH="/root/.cargo/bin:$PATH" ```
kerem 2026-03-01 21:48:16 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 18, 2024):

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

<!-- gh-comment-id:2174664214 --> @github-actions[bot] commented on GitHub (Jun 18, 2024): 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#1018
No description provided.