docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.84k stars 281 forks source link

failed to read Dockerfile on Windows 10 Pro #13586

Open anatoliy19 opened 1 year ago

anatoliy19 commented 1 year ago

Description

I get a docker error instead of containerise my app into Docker.

Diagnostics ID 16CC740A-481C-4623-B5EC-4E1881527558/20230706104735

image

Reproduce

  1. docker build -t mydockerapp-0.0.1 .
  2. I get this message:

1 [internal] load .dockerignore

1 transferring context: 2B done

1 DONE 0.0s

2 [internal] load build definition from Dockerfile

2 transferring dockerfile: 2B 0.0s done

2 DONE 0.0s

ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2601558829/Dockerfile: no such file or directory

Expected behavior

load metadata for docker

docker version

Docker version 24.0.2, build cb74dfc

docker info

Client:
 Version:    24.0.2
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.18.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.19
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.12.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 35
  Running: 18
  Paused: 0
  Stopped: 17
 Images: 11
 Server Version: 24.0.2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.15.90.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 5.653GiB
 Name: docker-desktop
 ID: 74e41114-d114-4803-a563-69ea25dabd41
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Diagnostics ID

16CC740A-481C-4623-B5EC-4E1881527558/20230706104735

Additional Info

No response

landism commented 12 months ago

Thanks for reporting! I think the most common cause of this is when the Dockerfile is named "dockerfile" with a lowercase "d", and it instead needs to be a capital "D". Is that the case for you?

https://github.com/docker/for-win/issues/8781#issuecomment-704962698

anatoliy19 commented 12 months ago

Thanks for reporting! I think the most common cause of this is when the Dockerfile is named "dockerfile" with a lowercase "d", and it instead needs to be a capital "D". Is that the case for you?

#8781 (comment)

No, that's not the case for me - in the picture above this post you can see a screen from my Project Explorer with the capital D of Dockerfile.

landism commented 12 months ago

Thanks! Sorry for not noticing that. Some other things I'd check when encountering this error:

anatoliy19 commented 11 months ago

When trying DOCKER_BUILDKIT=0 docker build . I get:

This is the first time I'm gonna conteinerize app into Docker.

I'm in the same directory of the Dockerfile image