Warm tip: This article is reproduced from serverfault.com, please click

Can you make any sense of Dockers error-messages?

发布于 2020-11-28 13:33:53

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
Questioner
MBaas
Viewed
0
ozs 2020-11-28 21:43:26

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