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 :
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
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:
As stated in different discussions on the Github Community: Source 1 + Source
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:
More informations and workarounds can be found here