Search code examples
docker-composegithub-actionscicd

why I can run docker-compose in Github action without install it


I make a copy/paste from the link here. I am confused about why I can run docker-compose without installing it. When I test locally using "act", it will give me an error about docker-compose command not found.

name: CI-dev-pipeline
on:
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop ]
jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: lucasalt/act_base:latest
    steps:
      - uses: actions/checkout@v2
        with:
          path: "<INSERT_NAME_OF_REPOSITORY>"

    - name: Build docker
      run: | 
        docker-compose -f ./<REPO_NAME>/docker-compose.test.yml -p testing up -d

Solution

  • You are using a docker-image from "lucasalt/act_base". If you look at the description of the images it states:

    act_base is a custom runner for the act project. This image contain Node, npm, yarn, docker and docker-compose.

    Meaning that it already downloads docker-compose etc. for you.