Cannot run docker-compose run command into self hosted runner

I have Github Actions hosted on AWS EC2 as a base for running tests on CI for applications being developed in Ruby on Rails.

use Docker + docker-compose for development, and we also use docker-compose in Github Actions to run tests and other commands.

Initially, it was working as expected, but since last month, when I used the docker-compose run command with Workflow, I had a problem with the container not starting.

tried to solve the problem, but I couldn’t find anything that would help me identify the problem, so I don’t know how to solve it.
Also, annoyingly, this problem only occurred when I was running Github Actions as Self Hosted Runner, but I was able to confirm that it worked fine on my hosted EC2.

Here is my configuration.

FROM ruby:2.7.1-alpine

RUN echo "" >> /etc/apk/repositories \
  apk update && apk upgrade && apk add --no-cache \
  libxml2-dev \
  libxslt-dev \
  build-base \
  mariadb-dev \
  mysql-client \
  tzdata \
  npm \
  less \
  imagemagick \
  openjdk8-jre \
  jruby \
  && rm -rf /var/cache/apk/*

RUN mkdir /grow


COPY Gemfile Gemfile.lock ./

RUN bundle config build.nokogiri --use-system-libraries

RUN bundle install

COPY . .
version: '3.3'
    container_name: app
      dockerfile: Dockerfile
      context: .
    command: bundle exec puma -C config/puma.rb
    stdin_open: true
    tty: true
    - 3000:3000

name: Test

on: pull_request

    name: test
    runs-on: self-hosted
      - name: Checkout
        uses: actions/checkout@v2

      - name: docker-compose build
        run: |
          docker-compose build

      - name: bundle install
        run: docker-compose run --rm api bundle install

The log on GIthub Actions

Creating api_run ... 
Creating api_run ... done
# This should be followed by bundle install, but it's not.


1 Like