skip to Main Content

As title says I was renaming one of my docker images I built using Dockerfile and docker-compose.yml using the command docker tag old-image-name new-image-name, after that I used docker images to check on my current images and I had BOTH the old and the new one.

I removed the old one using docker image rm IMAGE_ID and since then I’ve been getting the following error failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount511639725/Dockerfile: no such file or directory when I try to start the container.

I’ve tried everything, other containers start without problem and I’ve successfully ran this container in the past. This are the only changes I’ve made, nothing changed on my Dockerfile or docker-compose.yml.

I’ve tried removing the images related to this stack to build again many times. also tried rebuilding the image with Dockerfile alone (not trough docker-compose.yml).

2

Answers


  1. Chosen as BEST ANSWER

    I solved the problem, and it pains me that was very dumb on my side.

    When I had the container running I was adding some network changes on my docker-compose.yml to use NGINX with the django project.

    When I did those changes I changed build: . to build: ~/path/to/folder, I thought it would be able to recognize that path but apparently it has to be absolute or use the .

    Solution: reverting to build: . or build: /home/your_user/path/to/folder asuming your folder is in /home/your_user/*, avoid using ~

    Thanks for the replies everyone


  2. This error usually means it cannot find your docker file. It usually happens when its named incorrectly, make sure your docker file is named exactly as "Dockerfile"

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