Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you make any sense of Dockers error-messages?

I admit, I am a newbie in the container-world. But I managed to get docker running on my W10 with WSL2. I can also use the docker-UI and run Containers/Apps or Images. So I believe that the infrastructure is in place and uptodate. Yet, when I try even the simplest Dockerfile, it doesn't seem to work and I don't understand the error-messages it gives: This is Dockerfile:

FROM ubuntu:20.04

(yes, a humble beginning - or an extremly slimmed down repro)

docker build Dockerfile
[+] Building 0.0s (2/2) FINISHED
 => ERROR [internal] load build definition from Dockerfile                                                                                                                    0.0s
 => => transferring dockerfile: 33B                                                                                                                                           0.0s
 => ERROR [internal] load .dockerignore                                                                                                                                       0.0s
 => => transferring context: 33B                                                                                                                                              0.0s
------
 > [internal] load build definition from Dockerfile:
------
------
 > [internal] load .dockerignore:
------
failed to solve with frontend dockerfile.v0: failed to build LLB: error from sender: Dockerfile is not a directory
like image 539
MBaas Avatar asked Nov 28 '20 13:11

MBaas


People also ask

Why can't my Docker containers communicate with each other?

However, it can happen that your network's configuration changed at some point. In Docker, the setting responsible for this is called inter-container communication, or ICC. If the output is false, ICC is disabled, and containers in that network cannot communicate with each other.

When should you not use Docker?

Well, there are still several cases when not to use Docker. Here are seven of them. Let's go through these one by one. Docker containers are smaller and require fewer resources than a virtual machine with a server and a database. At the same time, Docker will use as much system resources as the host’s kernel scheduler will allow.

Can you run a GUI in a docker container?

Windows containers are based on either Nano or Core Server – it does not allow users to start up a GUI-based interface or a Docker RDP server in the Docker container. Yet, you can still run GUI-based applications developed with Python and the QT framework in a Linux container.

Does Docker use a lot of system resources?

Docker containers are smaller and require fewer resources than a virtual machine with a server and a database. At the same time, Docker will use as much system resources as the host’s kernel scheduler will allow. You should not expect Docker to speed up an application in any way.


3 Answers

You need to run docker build -f [docker_file_name] . (don't miss the dot at the end).

If the name of your file is Dockerfile then you don't need the -f and the filename.

like image 133
ozs Avatar answered Nov 11 '22 20:11

ozs


I faced a similar issue, I use the docker desktop for windows. Restarted the laptop and the issue was resolved. Hope it may help someone.

like image 28
Shreekanth Gaanji Avatar answered Nov 11 '22 20:11

Shreekanth Gaanji


For me, I had a Linux symlink in the same directory as the Dockerfile. When running docker build from Windows 10, it gave me the ERROR [internal] load build definition from Dockerfile. I suspect Docker docker build . scans the directory and, if it can't read one file, it crashes. For me, I mounted the directory with WSL and removed the symblink.

like image 33
Guilherme Ferreira Avatar answered Nov 11 '22 21:11

Guilherme Ferreira