docker-compose on windows-latest

I am getting an error when trying to build a docker-compose project on the windows-latest vm.

Run docker-compose build
Building composer
Step 1/18 : FROM node:12-alpine as build
12-alpine: Pulling from library/node
Service 'service-name' failed to build: no matching manifest for windows/amd64 10.0.17763 in the manifest list entries
##[error]Process completed with exit code 1.

My workflow looks like this:

    name: Docker Build
    timeout-minutes: 20
    runs-on: ${{ matrix.os }}
        os: [ubuntu-latest, windows-latest]

      - name: Checkout
        uses: actions/checkout@v1
      - name: docker-compose build
        run: docker-compose build
      - name: Health check
        run: |
          docker-compose up -d
          sleep 10
          curl -Is http://localhost:3000 | grep -q "200 OK"
        shell: bash
      - name: Cleanup
        if: always()
        run: docker-compose down

A quick search suggests maybe the docker configuration needs to be updated to “Use Linux Containers”, but I’m not sure if that’s necessary or possible in Github actions.

According to your error message, your Service ‘service-name’ on docker-compose are based on linux container. So you can’t use windows-latest runner to build it.

And in Github actions we can’t switch docker to use Linux Container when use windows-latest runner.