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 "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /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

WORKDIR /grow

COPY Gemfile Gemfile.lock ./

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

RUN bundle install

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

name: Test

on: pull_request

jobs:
  test:
    name: test
    runs-on: self-hosted
    steps:
      - 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.

Thanks

1 Like