skip to Main Content

i have project to automating deploy my docker when new commit in github.
I have been running docker in mac, and this my error i got :

error in github actions

Run docker build . --file Dockerfile --flask-webyogixyz2345
  docker build . --file Dockerfile --flask-webyogixyz2345
  shell: /bin/zsh {0}
/Users/runner/work/_temp/acce643b-8828-43ba-94ea-b7c7b4c8f4ab:1: command not found: docker
Error: Process completed with exit code 127.

and this my script in github actions

name: Docker Image CI

on:
  push:
    branches: [ "new-feature" ]
  pull_request:
    branches: [ "new-feature" ]

defaults:
  run:
    shell: zsh {0}
   

jobs:

  build:

    runs-on: macos-latest

    steps:
    
    - uses: actions/checkout@v3
    - name: Build the Docker image
      run: docker build . --file Dockerfile --flask-webyogixyz2345

can someone help me to solve this error ? thank youuu

no error in my github actions

2

Answers


  1. You will need to install docker on the runner. You can create a bash script that will install docker whichever way you would like but this is a docker supported git actions workflow you can use to set up docker:

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKER_USER }}
          password: ${{ secrets.DOCKER_TOKEN }}
    
    Login or Signup to reply.
  2. As stated in different discussions on the Github Community: Source 1 + Source

    Unfortunately, the docker community licensing is such that we are not able to install the docker for mac on our hosted runners. We have had some discussions with Docker about doing this but they have held firm on their request that using Docker on a service requires an enterprise license and docker enterprise is not at all supported on macOS.

    Note that for Windows, Microsoft holds the license for Docker Enterprise on Windows so we do not have any issues there and for Linux we use a specific build of Docker for Linux that is built and maintained by Azure.


    Fortunately, as explained in this issue, Colima (a container runtimes on macOS) has been added to the macos runner image.

    Which allows you to use docker commands, as below, on a macos runner:

    jobs:
       job:
         runs-on: macos-latest
         steps:
           - run: |
                brew install docker
                colima start
                docker run -e [...]
    

    More informations and workarounds can be found here

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