skip to Main Content

Hi my docker image build throws up the following error

[+] Building 0.0s (2/2) FINISHED
 => ERROR [internal] load build definition from Dockerfile                                                                                                                                      0.0s 
 => ERROR [internal] load .dockerignore                                                                                                                                                         0.0s 
------

 > [internal] load build definition from Dockerfile:
------
------
 > [internal] load .dockerignore:
------
failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to create lease: write /var/lib/docker/buildkit/containerdmeta.db: read-only file system

This is my Dockerfile

FROM python:3.10.5
WORKDIR /app
COPY requirements.txt .
COPY app.py .
COPY main.py .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]

I have tried many solutions but nothing works. Any idea how to resolve this isse?

2

Answers


  1. I got the same error
    failed to solve the frontend docker file.v0: was unable to read docker file: failed to create lease: read-only file system

    Solution:

    1. I just stopped the Docker desktop service and close the visual code.
    2. Next I restart the laptop
    3. then start the docker desktop service
    4. open Vscode and run the docker build command (docker build -t "image name" . (don’t miss the last dot)

    Finally, It worked for me.

    Login or Signup to reply.
  2. docker : #1 [internal] load build definition from Dockerfile
    

    I had this same issue when trying to build a Dockerfile from Windows Powershell ISE as I was working on a script. When I actually opened a Powershell shell and ran the same script then everything worked fine.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search