Container Volume mount incomplete

Hello everybody.

I have the following problem. For some reason the checked-out directory is not or not fully mounted. The output ls -all (Test) contains all files. Most of the files are missing when I run the output in my Docker container (Test2).

Does anyone have the same problems or can tell me what I’m doing wrong?

Workflow

name: "Continuous Integration"

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  pre:
    runs-on: self-hosted

    container:
      image: docker/compose
      options: "-v \"/home/aubiplus/actions-runner/_work\":\"/var/www/stack\":ro,shared"
     
    steps:
    - name: "Container prerequisites"
      run: |
        apk add --no-cache git
          
    - name: "Checkout Project"
      uses: actions/checkout@v2
      with:
        clean: false

    - name: "Test"
      run: |
        ls -la /__w/stack/stack
   
    - name: "Run [docker-compose build]"
      run: |
        docker-compose --log-level INFO up -d --build
    
    - name: "Test2"
      run: |
        docker-compose exec -T php sh -c "ls -all /var/www/stack"

Docker-Compose

version: '3'

services:
  php:
    container_name: stack_php_1
    build: ./docker/php
    networks:
      - development
    volumes:
      - "phpsocket:/run/php"
    environment:
      - TZ=Europe/Berlin

networks:
  development:

volumes:
  phpsocket:

Thanks for your feedback.
Based on your workflow yml file, you specify job.container for job pre . All the steps will be executed on the container. So the container “stack_php_1“ in your Docker-Compose file will run inside the container ( with image docker/compose), too.

/home/aubiplus/actions-runner/_work(on the self-hosted runner machine) is mapped to __w (inside container docker/compose) in default. So when

ls -la /__w/stack/stack (Test) you can see all files.

There is no volume to map the checked-out directory from job container (with image docker/compose) to container “stack_php_1“ /var/www/stack.

So ls -all /var/www/stack could not show the checkout repo files.