skip to Main Content

You can think about it this way, "Is there a way to use docker in GitHub Actions with a macos runner?" But it’s not like I need it there. Whatever the way to gets one’s hands on a MacOS environment, is there a way to install and use it w/o GUI? The whole way from installing docker to running a container.

The reason I need it is to reproduce an issue that manifests itself on MacOS in a docker container.

2

Answers


  1. Yes, there actually is, you can use the jobs.<job_id>.runs-on, and here’s how you do it:

    jobs:
      build:
        runs-on: macOS-latest
        steps:
          - name: Checkout code
            uses: actions/checkout@v2
          - name: Build and test
            run: |
              docker build -t my-image .
              docker run my-image npm test
    
    Login or Signup to reply.
    1. Install Homebrew:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    1. Install Docker using Homebrew:
    brew install --cask docker
    

    Is that what you’re looking for? 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search