[GH-ISSUE #1073] Volume mounting issues with file built within pipeline #623

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

Originally created by @jonny7 on GitHub (Mar 24, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1073

I should prefix, with I'm not sure if this is a bug or I just need guidance on how to manage volume mounting for my setup. Because I am seeing unexpected results with act at either the current or previous version when trying to mount a file. I have a reproducible effort though so you can see if this is my problem.

System information

- Operating System: macOS
- Architecture: x64 (64-bit)
- Apple M1: no 
- Docker version: 20.10.12
- `act` version: 0.2.26

Expected behaviour

I am building a config file in my workflow and then trying to mount that into Docker. This works as expected in GH actions, but fails with act

Actual behaviour

It fails to mount the newly created file and creates a directory in my repo with the expected filename. I think this is Docker creating the directory however, because act doesn't supply the created file to Docker, I could be wrong though. This ultimately results in:

| ERROR: for act-example_nginx_1 Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/Users/me/code/act-example/nginx.conf" to rootfs at "/etc/nginx/nginx.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

Workflow and/or repository

This volumes branch has a fully reproducible example. https://github.com/jonny7/act-example/tree/volumes. This will run fine on GH actions, but fail in act. I should note I am using my own container that is wrapped with docker-compose. That Dockerfile is also in the repo. I've wrapped it with sudo for installing docker-compose and previously there was no sudo. It still has the same results however.

jobs:
  skip-pipeline:
    runs-on: ubuntu-latest
    steps:
    
    - name: Checkout repos
      uses: actions/checkout@v2
    
    - name: Build file
      run: |
        cat <<\EOT >nginx.conf
        events {
          worker_connections 1024;
        }
        http {
          server {
            listen 8080;
          }
        }
        EOT
        cat nginx.conf
    
    - name: Do docker stuff with volume
      run: |
        docker-compose build
        docker-compose up --abort-on-container-exit

Steps to reproduce

  • clone the repo
  • switch to the volumes branch
  • build and tag the docker image from the Dockerfile
  • run act pull_request -P ubuntu-latest=your/tagged-image

act output

As noted above

Originally created by @jonny7 on GitHub (Mar 24, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1073 I should prefix, with I'm not sure if this is a bug or I just need guidance on how to manage volume mounting for my setup. Because I am seeing unexpected results with act at either the current or previous version when trying to mount a file. I have a reproducible effort though so you can see if this is my problem. ## System information - Operating System: macOS - Architecture: x64 (64-bit) - Apple M1: no - Docker version: 20.10.12 - `act` version: 0.2.26 ## Expected behaviour I am building a config file in my workflow and then trying to mount that into Docker. This works as expected in GH actions, but fails with act ## Actual behaviour It fails to mount the newly created file and creates a directory in my repo with the expected filename. I think this is Docker creating the directory however, because act doesn't supply the created file to Docker, I could be wrong though. This ultimately results in: > | ERROR: for act-example_nginx_1 Cannot start service nginx: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/Users/me/code/act-example/nginx.conf" to rootfs at "/etc/nginx/nginx.conf" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type ## Workflow and/or repository This `volumes` branch has a fully reproducible example. https://github.com/jonny7/act-example/tree/volumes. This will run fine on GH actions, but fail in act. I should note I am using my own container that is wrapped with `docker-compose`. That `Dockerfile` is also in the repo. I've wrapped it with sudo for installing `docker-compose` and previously there was no `sudo`. It still has the same results however. ```yaml jobs: skip-pipeline: runs-on: ubuntu-latest steps: - name: Checkout repos uses: actions/checkout@v2 - name: Build file run: | cat <<\EOT >nginx.conf events { worker_connections 1024; } http { server { listen 8080; } } EOT cat nginx.conf - name: Do docker stuff with volume run: | docker-compose build docker-compose up --abort-on-container-exit ``` ## Steps to reproduce - clone the repo - switch to the `volumes` branch - build and tag the docker image from the `Dockerfile` - run ` act pull_request -P ubuntu-latest=your/tagged-image ` ## `act` output As noted above
kerem 2026-03-01 21:45:02 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 24, 2022):

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

<!-- gh-comment-id:1107670010 --> @github-actions[bot] commented on GitHub (Apr 24, 2022): 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#623
No description provided.