docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.28k stars 550 forks source link

Fails with message "error: failed to solve: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount974778626/Dockerfile: no such file or directory" #574

Closed yannoff closed 2 years ago

yannoff commented 2 years ago

Troubleshooting

Can't use the action

# vim: ts=4 sw=4 sts=4 retab

name: Deploy

on:
    - push

jobs:
    deploy:
        name: Deploy to dockerhub
        runs-on: ubuntu-latest
        steps:
            - name: Use docker build & push
              uses: docker/build-push-action@v2
            - name: Run deploy script
              run: deploy.sh

Logs

2022-03-20T22:09:32.2056801Z Requested labels: ubuntu-latest
2022-03-20T22:09:32.2056852Z Job defined at: yannoff/docker-php-fpm/.github/workflows/publish.yaml@refs/heads/feature/automate-push
2022-03-20T22:09:32.2056877Z Waiting for a runner to pick up this job...
2022-03-20T22:09:32.4948388Z Job is waiting for a hosted runner to come online.
2022-03-20T22:09:37.7057116Z Job is about to start running on the hosted runner: Hosted Agent (hosted)
2022-03-20T22:09:39.5869802Z Current runner version: '2.288.1'
2022-03-20T22:09:39.5896193Z ##[group]Operating System
2022-03-20T22:09:39.5897050Z Ubuntu
2022-03-20T22:09:39.5897344Z 20.04.4
2022-03-20T22:09:39.5897700Z LTS
2022-03-20T22:09:39.5898049Z ##[endgroup]
2022-03-20T22:09:39.5898396Z ##[group]Virtual Environment
2022-03-20T22:09:39.5898885Z Environment: ubuntu-20.04
2022-03-20T22:09:39.5899327Z Version: 20220227.1
2022-03-20T22:09:39.5899957Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220227.1/images/linux/Ubuntu2004-Readme.md
2022-03-20T22:09:39.5900709Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220227.1
2022-03-20T22:09:39.5901266Z ##[endgroup]
2022-03-20T22:09:39.5901742Z ##[group]Virtual Environment Provisioner
2022-03-20T22:09:39.5902136Z 1.0.0.0-main-20220307-1
2022-03-20T22:09:39.5902512Z ##[endgroup]
2022-03-20T22:09:39.5903666Z ##[group]GITHUB_TOKEN Permissions
2022-03-20T22:09:39.5904411Z Actions: write
2022-03-20T22:09:39.5904919Z Checks: write
2022-03-20T22:09:39.5905307Z Contents: write
2022-03-20T22:09:39.5905784Z Deployments: write
2022-03-20T22:09:39.5906129Z Discussions: write
2022-03-20T22:09:39.5906512Z Issues: write
2022-03-20T22:09:39.5906884Z Metadata: read
2022-03-20T22:09:39.5907208Z Packages: write
2022-03-20T22:09:39.5907648Z Pages: write
2022-03-20T22:09:39.5908033Z PullRequests: write
2022-03-20T22:09:39.5908407Z RepositoryProjects: write
2022-03-20T22:09:39.5908833Z SecurityEvents: write
2022-03-20T22:09:39.5909239Z Statuses: write
2022-03-20T22:09:39.5909591Z ##[endgroup]
2022-03-20T22:09:39.5914033Z Secret source: Actions
2022-03-20T22:09:39.5914700Z Prepare workflow directory
2022-03-20T22:09:39.6816024Z Prepare all required actions
2022-03-20T22:09:39.7024168Z Getting action download info
2022-03-20T22:09:39.9268626Z Download action repository 'docker/build-push-action@v2' (SHA:ac9327eae2b366085ac7f6a2d02df8aa8ead720a)
2022-03-20T22:09:40.4792288Z ##[group]Run docker/build-push-action@v2
2022-03-20T22:09:40.4792984Z with:
2022-03-20T22:09:40.4793265Z   load: false
2022-03-20T22:09:40.4793541Z   no-cache: false
2022-03-20T22:09:40.4793833Z   pull: false
2022-03-20T22:09:40.4794118Z   push: false
2022-03-20T22:09:40.4794679Z   github-token: ***
2022-03-20T22:09:40.4794988Z ##[endgroup]
2022-03-20T22:09:40.7388029Z ##[group]Docker info
2022-03-20T22:09:40.7402145Z [command]/usr/bin/docker version
2022-03-20T22:09:40.9225862Z Client:
2022-03-20T22:09:40.9357371Z  Version:           20.10.11+azure-3
2022-03-20T22:09:40.9357763Z  API version:       1.41
2022-03-20T22:09:40.9358312Z  Go version:        go1.16.12
2022-03-20T22:09:40.9358727Z  Git commit:        dea9396e184290f638ea873c76db7c80efd5a1d2
2022-03-20T22:09:40.9359116Z  Built:             Wed Nov 17 23:49:46 2021
2022-03-20T22:09:40.9361698Z  OS/Arch:           linux/amd64
2022-03-20T22:09:40.9362075Z  Context:           default
2022-03-20T22:09:40.9362508Z  Experimental:      true
2022-03-20T22:09:40.9362736Z 
2022-03-20T22:09:40.9362847Z Server:
2022-03-20T22:09:40.9363167Z  Engine:
2022-03-20T22:09:40.9363611Z   Version:          20.10.11+azure-3
2022-03-20T22:09:40.9364038Z   API version:      1.41 (minimum version 1.12)
2022-03-20T22:09:40.9364417Z   Go version:       go1.16.12
2022-03-20T22:09:40.9364842Z   Git commit:       847da184ad5048b27f5bdf9d53d070f731b43180
2022-03-20T22:09:40.9365275Z   Built:            Thu Nov 18 00:21:59 2021
2022-03-20T22:09:40.9365618Z   OS/Arch:          linux/amd64
2022-03-20T22:09:40.9365973Z   Experimental:     false
2022-03-20T22:09:40.9366345Z  containerd:
2022-03-20T22:09:40.9366699Z   Version:          1.4.12+azure-2
2022-03-20T22:09:40.9367137Z   GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
2022-03-20T22:09:40.9367530Z  runc:
2022-03-20T22:09:40.9367819Z   Version:          1.0.3
2022-03-20T22:09:40.9368276Z   GitCommit:        f46b6ba2c9314cfc8caae24a32ec5fe9ef1059fe
2022-03-20T22:09:40.9368743Z  docker-init:
2022-03-20T22:09:40.9369062Z   Version:          0.19.0
2022-03-20T22:09:40.9369429Z   GitCommit:        
2022-03-20T22:09:40.9370131Z [command]/usr/bin/docker info
2022-03-20T22:09:41.2918117Z Client:
2022-03-20T22:09:41.2919270Z  Context:    default
2022-03-20T22:09:41.2919632Z  Debug Mode: false
2022-03-20T22:09:41.2919963Z  Plugins:
2022-03-20T22:09:41.2920628Z   buildx: Docker Buildx (Docker Inc., 0.7.1+azure-2)
2022-03-20T22:09:41.2921143Z   compose: Docker Compose (Docker Inc., 2.2.3+azure-1)
2022-03-20T22:09:41.2921430Z 
2022-03-20T22:09:41.2921593Z Server:
2022-03-20T22:09:41.2921896Z  Containers: 0
2022-03-20T22:09:41.2922202Z   Running: 0
2022-03-20T22:09:41.2922491Z   Paused: 0
2022-03-20T22:09:41.2922792Z   Stopped: 0
2022-03-20T22:09:41.2923091Z  Images: 19
2022-03-20T22:09:41.2923441Z  Server Version: 20.10.11+azure-3
2022-03-20T22:09:41.2923789Z  Storage Driver: overlay2
2022-03-20T22:09:41.2924193Z   Backing Filesystem: extfs
2022-03-20T22:09:41.2924529Z   Supports d_type: true
2022-03-20T22:09:41.2924917Z   Native Overlay Diff: false
2022-03-20T22:09:41.2925251Z   userxattr: false
2022-03-20T22:09:41.2925651Z  Logging Driver: json-file
2022-03-20T22:09:41.2925992Z  Cgroup Driver: cgroupfs
2022-03-20T22:09:41.2926324Z  Cgroup Version: 1
2022-03-20T22:09:41.2926631Z  Plugins:
2022-03-20T22:09:41.2926920Z   Volume: local
2022-03-20T22:09:41.2927335Z   Network: bridge host ipvlan macvlan null overlay
2022-03-20T22:09:41.2927959Z   Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
2022-03-20T22:09:41.2928388Z  Swarm: inactive
2022-03-20T22:09:41.2928830Z  Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
2022-03-20T22:09:41.2929261Z  Default Runtime: runc
2022-03-20T22:09:41.2929704Z  Init Binary: docker-init
2022-03-20T22:09:41.2930130Z  containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
2022-03-20T22:09:41.2930847Z  runc version: f46b6ba2c9314cfc8caae24a32ec5fe9ef1059fe
2022-03-20T22:09:41.2931231Z  init version: 
2022-03-20T22:09:41.2931870Z  Security Options:
2022-03-20T22:09:41.2932192Z   apparmor
2022-03-20T22:09:41.2932487Z   seccomp
2022-03-20T22:09:41.2932800Z    Profile: default
2022-03-20T22:09:41.2933218Z  Kernel Version: 5.11.0-1028-azure
2022-03-20T22:09:41.2933577Z  Operating System: Ubuntu 20.04.4 LTS
2022-03-20T22:09:41.2933916Z  OSType: linux
2022-03-20T22:09:41.2934236Z  Architecture: x86_64
2022-03-20T22:09:41.2934537Z  CPUs: 2
2022-03-20T22:09:41.2934843Z  Total Memory: 6.785GiB
2022-03-20T22:09:41.2935220Z  Name: fv-az210-802
2022-03-20T22:09:41.2935605Z  ID: DFUV:3MIO:QJB4:SFAI:CWPP:LEBI:ETH4:AT3U:T5PZ:KRMI:AS3I:HDYW
2022-03-20T22:09:41.2936009Z  Docker Root Dir: /var/lib/docker
2022-03-20T22:09:41.2936341Z  Debug Mode: false
2022-03-20T22:09:41.2936667Z  Username: githubactions
2022-03-20T22:09:41.2937164Z  Registry: https://index.docker.io/v1/
2022-03-20T22:09:41.2937523Z  Labels:
2022-03-20T22:09:41.2937829Z  Experimental: false
2022-03-20T22:09:41.2938145Z  Insecure Registries:
2022-03-20T22:09:41.2938460Z   127.0.0.0/8
2022-03-20T22:09:41.2938896Z  Live Restore Enabled: false
2022-03-20T22:09:41.2939112Z 
2022-03-20T22:09:41.2950467Z ##[endgroup]
2022-03-20T22:09:41.4855156Z [command]/usr/bin/docker buildx build --iidfile /tmp/docker-build-push-fzdsuK/iidfile --secret id=GIT_AUTH_TOKEN,src=/tmp/docker-build-push-fzdsuK/tmp-1475-qdzvdZECscGT --metadata-file /tmp/docker-build-push-fzdsuK/metadata-file https://github.com/yannoff/docker-php-fpm.git#d7b0820e55be0625d3a925e52d1ae85b309d1356
2022-03-20T22:09:41.8775728Z #1 [internal] load git source https://github.com/yannoff/docker-php-fpm.git#d7b0820e55be0625d3a925e52d1ae85b309d1356
2022-03-20T22:09:41.8777054Z #1 0.029 hint: Using 'master' as the name for the initial branch. This default branch name
2022-03-20T22:09:41.8777867Z #1 0.029 hint: is subject to change. To configure the initial branch name to use in all
2022-03-20T22:09:41.8778631Z #1 0.030 hint: of your new repositories, which will suppress this warning, call:
2022-03-20T22:09:41.8779207Z #1 0.030 hint: 
2022-03-20T22:09:41.8779992Z #1 0.031 hint:     git config --global init.defaultBranch <name>
2022-03-20T22:09:41.8781024Z #1 0.031 hint: 
2022-03-20T22:09:41.8781806Z #1 0.031 hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2022-03-20T22:09:41.8782780Z #1 0.031 hint: 'development'. The just-created branch can be renamed via this command:
2022-03-20T22:09:41.8783380Z #1 0.031 hint: 
2022-03-20T22:09:41.8783967Z #1 0.032 hint:     git branch -m <name>
2022-03-20T22:09:41.8784703Z #1 0.032 Initialized empty Git repository in /var/lib/docker/overlay2/m7tibn1c9eccp0pkb4xwq843p/diff/
2022-03-20T22:09:41.8785563Z #1 0.040 fatal: Not a valid object name d7b0820e55be0625d3a925e52d1ae85b309d1356^{commit}
2022-03-20T22:09:42.0908738Z #1 0.315 From https://github.com/yannoff/docker-php-fpm
2022-03-20T22:09:42.0939618Z #1 0.315  * [new branch]      debug                   -> origin/debug
2022-03-20T22:09:42.0940113Z #1 0.315  * [new branch]      dev-kit                 -> origin/dev-kit
2022-03-20T22:09:42.0940604Z #1 0.315  * [new branch]      develop                 -> origin/develop
2022-03-20T22:09:42.0941156Z #1 0.316  * [new branch]      feature/automate-push   -> origin/feature/automate-push
2022-03-20T22:09:42.0941734Z #1 0.316  * [new branch]      feature/bin-helpers-set -> origin/feature/bin-helpers-set
2022-03-20T22:09:42.0942395Z #1 0.316  * [new branch]      feature/custom-docker-php-scripts -> origin/feature/custom-docker-php-scripts
2022-03-20T22:09:42.0943071Z #1 0.316  * [new branch]      feature/development-kit-image -> origin/feature/development-kit-image
2022-03-20T22:09:42.0943685Z #1 0.316  * [new branch]      feature/externalize-scripts -> origin/feature/externalize-scripts
2022-03-20T22:09:42.0944433Z #1 0.316  * [new branch]      feature/improve-extensions-install-handling -> origin/feature/improve-extensions-install-handling
2022-03-20T22:09:42.0945175Z #1 0.316  * [new branch]      feature/reduce-base-images-size -> origin/feature/reduce-base-images-size
2022-03-20T22:09:42.0946071Z #1 0.316  * [new branch]      feature/remove-root-dockerfile -> origin/feature/remove-root-dockerfile
2022-03-20T22:09:42.0946742Z #1 0.317  * [new branch]      feature/separate-build-and-push -> origin/feature/separate-build-and-push
2022-03-20T22:09:42.0947499Z #1 0.317  * [new branch]      fix/make-fails-on-dockerhub-auto-builds -> origin/fix/make-fails-on-dockerhub-auto-builds
2022-03-20T22:09:42.0948108Z #1 0.317  * [new branch]      master                  -> origin/master
2022-03-20T22:09:42.0948382Z #1 DONE 0.4s
2022-03-20T22:09:42.0949095Z error: failed to solve: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount974778626/Dockerfile: no such file or directory
2022-03-20T22:09:42.0996292Z ##[error]buildx failed with: error: failed to solve: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount974778626/Dockerfile: no such file or directory
2022-03-20T22:09:42.1228095Z Post job cleanup.
2022-03-20T22:09:42.2688077Z ##[group]Removing temp folder /tmp/docker-build-push-fzdsuK
2022-03-20T22:09:42.2703959Z ##[endgroup]
2022-03-20T22:09:42.2894446Z Cleaning up orphan processes
alismx commented 2 years ago

Chiming in because I just saw this earlier; it happened when I didn't supply the proper path to my Dockerfile.

I was set up like this:

context: frontend
file: Dockerfile

It needed to be set up like this:

context: frontend
file: frontend/Dockerfile

So I think that you need to be sure to supply the correct path to the Dockerfile from your current working directory.

yannoff commented 2 years ago

@alismx Thanks for the reply and for the tip :smiley_cat: I'll give it a try :rocket:

moussetc commented 2 years ago

Note: if you have exactly the same issue, but adding the context input does not work, check that you haven't excluded the file you're trying to copy (or the target folder that contains it) in your .dockerignore...

jdaolearning917 commented 1 year ago

Note, if you are following the tutorial and you extract the ZIP > you'll have 2 app locations. one in getting started and one where ever you extract. Make sure the Dockerfile you created is saved inside the getting-started path under /app and not inside the extracted location

Example: "C:\Users\peanut\getting-started\app" - save it here bad path: "C:\Users\Peanut\Downloads\app"

i had it in the wrong path