getting-started
getting-started copied to clipboard
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2920458239/Dockerfile: no such file or directory
This is on Page 2 "Our Application" Step 2 of the tutorial. I have downloaded the Zip and extracted it. Have the app folder open in visual studio code I have created the Docker file in the same folder as package.json Docker has no extension.
I put the following into the terminal docker build -t getting-started .
And I see this
[+] Building 5.4s (2/2) FINISHED => [internal] load build definition from Dockerfile 2.9s => => transferring dockerfile: 2B 0.0s => [internal] load .dockerignore 4.5s => => transferring context: 2B 0.0s failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2920458239/Dockerfile: no such file or directory
I have done my best to go through the rest of the tutorial but since most things don't really work after this point, I'm not sure it I'm getting it or not. I have found a few cases of needing to use a different command than what is in the tutorial's copy box.
For instance on "Multi-Container Apps" Step 3 it says to use mysql> SHOW DATABASES; to show the database but it should just have SHOW DATABASES; in the box.
Hi there! Apologies for the delayed response. Did you end up figuring it out?
Make sure the file name is exactly Dockerfile
with no file extension. And then when you run the command, make sure you do so while in the same directory as your file.
If you're still having trouble, feel free to respond and we'll help you get going again!
Hy. I have the same problem.
I'm running an Ubuntu 22.02.02 LTS and just install "docker-ce docker-ce-cli containerd.io and nginx-core" from apt. I made a directory nginx-image/files and created "Dockerfile, default, and index.html"
This is cat from Dockerfile:
' FROM ubuntu:22.04
LABEL maintainer="[email protected]" RUN apt-get -y update && apt-get -y install nginx COPY files/default /etc/nginx/sites-available/default COPY files/index.html /usr/share/nginx/html/index.html EXPOSE 80 CMD ["/usr/sbin/nginx", "-g", "daemon off;"] '
But when a run from the ngins-image folder this >> docker -D -l "debug" build -t nginx:1.0 .
I obtain this:
[+] Building 1.2s (2/2) FINISHED docker:default => [internal] load build definition from Dockerfile 0.3s => => transferring dockerfile: 2B 0.0s => [internal] load .dockerignore 0.7s => => transferring context: 34B 0.0s ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1784619983/Dockerfile: no such file or directory [...]
I am not able to solve it I tried prune, listing the directory ../tmp but is empty, changing the permission but nothing came out from this.
¿Can I ask you for some guide? Thank you.
=> => transferring context: 2B 0.0s => [internal] load build definition from Dockerfile 1.1s => => transferring dockerfile: 318B 0.0s => [internal] load metadata for docker.io/library/ubuntu:22.04 2.0s => CANCELED [1/4] FROM docker.io/library/ubuntu:22.04@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508 1.2s => => resolve docker.io/library/ubuntu:22.04@sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508 0.7s => => sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508 1.13kB / 1.13kB 0.0s => => sha256:b060fffe8e1561c9c3e6dea6db487b900100fc26830b9ea2ec966c151ab4c020 424B / 424B 0.0s => => sha256:5a81c4b8502e4979e75bd8f91343b95b0d695ab67f241dbed0d1530a35bde1eb 2.30kB / 2.30kB 0.0s => [internal] load build context 0.8s => => transferring context: 2B 0.0s => CACHED [2/4] RUN apt-get -y update && apt-get -y install nginx 0.0s => ERROR [3/4] COPY files/default /etc/nginx/sites-available/default 0.0s => ERROR [4/4] COPY files/index.html /usr/share/nginx/html/index.html 0.0s
[3/4] COPY files/default /etc/nginx/sites-available/default:
[4/4] COPY files/index.html /usr/share/nginx/html/index.html:
Dockerfile:5
3 | RUN apt-get -y update && apt-get -y install nginx 4 | COPY files/default /etc/nginx/sites-available/default 5 | >>> COPY files/index.html /usr/share/nginx/html/index.html 6 | EXPOSE 80 7 | CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref e1cafacb-c1f9-43c5-b151-1b13623aa210::oz0a5ase8jpzdt70c44cf0xeh: failed to walk /var/lib/docker/tmp/buildkit-mount2262473555/files: lstat /var/lib/docker/tmp/buildkit-mount2262473555/files: no such file or directory
I solved it by adding "-f files/Dockerfile" to the command and executing it from the parent directori "nginx-image".
/Documentos/nginx-image$ .docker build -f files/Dockerfile -t nginx:1.0
And it worked properly.
Thanks!