act icon indicating copy to clipboard operation
act copied to clipboard

Inconsistency using custom Docker image

Open sockmaster27 opened this issue 2 years ago • 1 comments

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?

Link to GitHub repository

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"

sockmaster27 avatar Dec 20 '23 12:12 sockmaster27

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

github-actions[bot] avatar Jun 18 '24 00:06 github-actions[bot]