Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: stat "": no such file or directory #194

Open
chester-personaify opened this issue Oct 25, 2023 · 0 comments
Open

ERROR: stat "": no such file or directory #194

chester-personaify opened this issue Oct 25, 2023 · 0 comments

Comments

@chester-personaify
Copy link

Running into this weird error when trying to use with Github action to build a docker container

This is the output error logs (some parts redacted):

Run webfactory/[email protected]  
Starting ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXK8W2BZ/agent.2180
SSH_AGENT_PID=2181
Adding private key(s) to agent
Identity added: (stdin) (https://github.com/owner/repo)
Key(s) added:
25[6](https://github.com/owner/repo/actions/runs/.../job/...#step:4:6) SHA25[6](https://github.com/owner/repo/actions/runs/.../job/...#step:4:7):... https://github.com/owner/repo (ED25519)
Configuring deployment key(s)
Added deploy-key mapping: ....

....

Buildx version
  /usr/bin/docker buildx version
  github.com/docker/buildx v0.11.2 9872040
/usr/bin/docker buildx build --file ./Dockerfile --iidfile /tmp/docker-build-push-l5b75b/iidfile --provenance false --secret id=GIT_AUTH_TOKEN,src=/tmp/docker-build-push-l5b75b/tmp-2407-B4eeUuOAcea7 --ssh default="" --tag ***.azurecr.io/rest:c0f74278aeeb4fd5044441f1938f927fc64f7409 --tag ***.azurecr.io/rest:latest --metadata-file /tmp/docker-build-push-l5b75b/metadata-file --push https://github.com/owner/repo.git#c0f74278aeeb4fd5044441f1938f927fc64f7409
ERROR: stat "": no such file or directory
Error: buildx failed with: ERROR: stat "": no such file or directory

Here's my yml file:

jobs:
  build:
    runs-on: 'ubuntu-latest'

    steps:
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3

    - name: Log in to registry
      uses: docker/login-action@v3
      with:
        registry: https://regname.azurecr.io/
        username: ${{ secrets.AzureAppService_ContainerUsername }}
        password: ${{ secrets.AzureAppService_ContainerPassword }}

    - name: Setup ssh-agent
      uses: webfactory/[email protected]
      with:
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

    - name: replace requirements
       run: sed -i "s/https:\/\/git@github\.com/ssh:\/\/git@github\.com/g" requirements.txt
      
    - name: Build and push container image to registry
      uses: docker/build-push-action@v3
      with:
        ssh: |
          default="${{ secrets.SSH_AUTH_SOCK }}"
        push: true
        tags: regname.azurecr.io/rest:${{ github.sha }}, regname.azurecr.io/rest:latest
        file: ./Dockerfile
  1. I've added the public ssh key as a deploy key to the github repo
  2. I've added the private ssh key as a secret in the repo SSH_PRIVATE_KEY
  3. I've tried using docker/build-push-action@v2 instead of v3.

Does anyone know what's going on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant