Buildx: Docker build with dockerfile fails

Created on 7 Oct 2020  路  6Comments  路  Source: docker/buildx

  • [x] I have uploaded Diagnostics
  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • Diagnostics ID: DFC9720C-F5C8-41E5-AB29-6BDBC3491743/20201007084617

Expected behavior

Docker should build image.

Actual behavior

[+] Building 0.0s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                   0.0s 
 => => transferring dockerfile: 2B                                                                                                                                                                                                                                                                                     0.0s 
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                      0.0s 
 => => transferring context: 2B                                                                                                                                                                                                                                                                                        0.0s 
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount170234300/Dockerfile: no such file or directory

Information

  • Windows Version: Windows 10 Pro Version 2004 os build 19041.508
  • Docker Desktop Version: Docker version 19.03.13, build 4484c46d9d (tested also with stable)
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: nope.

Steps to reproduce the behavior

  1. Install Docker Desktop on Windows.
  2. Install nginx-image to docker.
  3. Create test.dockerfile with:
FROM nginx:latest
ADD . /usr/share/nginx/html
  1. Add index.html with only header text.
  2. run in folder with dockerfile and index.html powershell terminal command docker build -t website:latest .

Most helpful comment

Thanks for the reports. Does it fix it if you turn off buildkit (see https://docs.docker.com/docker-for-windows/release-notes/#docker-desktop-community-2400 for instructions)?

All 6 comments

Thanks for the reports. Does it fix it if you turn off buildkit (see https://docs.docker.com/docker-for-windows/release-notes/#docker-desktop-community-2400 for instructions)?

hmm, looks like dockerfile can't have two parts, "test.dockerfile" is not picked but only "dockerfile" works.
Is this indended?

Thanks for the reports. Does it fix it if you turn off buildkit (see https://docs.docker.com/docker-for-windows/release-notes/#docker-desktop-community-2400 for instructions)?

I've encountered the same issue and can confirm turning off buildkit does resolve it.

Information
Windows Version: Windows 10 Pro Version 10.0.18363 Build 18363
Docker Desktop Version: Docker version 19.03.13 build 4484c46d9d
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: Running locally on Microsoft laptop

Steps to reproduce
Same as Aaltis, here is the test dockerfile I used:

FROM python:3.7
WORKDIR /HOME

Error message

[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 2B                                                                                 0.0s
 => [internal] load .dockerignore                                                                                  0.1s
 => => transferring context: 2B                                                                                    0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount848492301/Dockerfile: no such file or directory

OK, thanks, I'm going to transfer this ticket to the buildx repo.

docker build -t website:latest . is not supposed to work with test.dockerfile. docker build -f test.dockerfile -t website:latest .

My dockerfile was named dockerfile and still encountered the build failure. Should I be creating a new github issue then?

docker build -t website:latest . is not supposed to work with test.dockerfile. docker build -f test.dockerfile -t website:latest .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dubo-dubon-duponey picture dubo-dubon-duponey  路  10Comments

patrickelectric picture patrickelectric  路  7Comments

Julio-Guerra picture Julio-Guerra  路  4Comments

smurfpandey picture smurfpandey  路  5Comments

blabla1337 picture blabla1337  路  10Comments