I have a GitHub workflow to build java application and build a docker image and push to Azure Container Registry. In the GitHub hosted runner the workflow is running fine.
I need to work the same in a Self Hosted runner. So I have created a VM in Azure and configured the Github runner and updated the workflow to run-on to selfhosted runner.
name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account show
name: Login to ACR
uses: docker/login-action@v3
with:
registry: ${{ secrets.xxxxxxxxx }}
username: ${{ secrets.xxxxxxxxx }}
password: ${{ secrets.xxxxxxxxx }}
name: Use Java 19
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '19'
These are the examples of some github actions I use, this is working fine on the github runner. But when I change to GitHub runner to self hosted runner its showing errors
Error: Unable to locate executable file: az. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable.
Error: Unable to locate executable file: docker. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable.
When I login in to the VM and installed the azure cli manually the first error was gone.
So my question is do we need to install each packages and tools we use in the github action manually inside the selfhosted VM. Or will it comes automatically while we configure the github runner?
I have configured the github selfhosted runner inside a VM. I have triggered the workflow. Getting error unable to locate the packages inside my github actions
AkshayMuralidharan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1