Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to read dockerfile #119

Open
matheusfd3 opened this issue Nov 20, 2024 · 2 comments
Open

failed to read dockerfile #119

matheusfd3 opened this issue Nov 20, 2024 · 2 comments

Comments

@matheusfd3
Copy link

  • Ubuntu 24.04.1 LTS
  • Docker Desktop 4.36.0

command:
docker buildx build --platform linux/amd64,linux/arm64 -t readme-ai --push .

out:
matheus in ~ took 16,4s ➜ docker buildx build --platform linux/amd64,linux/arm64 -t readme-ai --push . [+] Building 0.1s (1/1) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 2B 0.0s ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

@diekotto
Copy link
Contributor

diekotto commented Jan 5, 2025

I'm taking a look on this one.

@diekotto
Copy link
Contributor

diekotto commented Jan 5, 2025

Hi @matheusfd3! Thanks for reporting this issue. I've just tested the command on both linux and windows with Docker Desktop and it seems to be working correctly.

The error you're getting suggests that Docker can't find the Dockerfile in your current directory:

ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

This typically occurs in two common scenarios:

  1. The command is being executed from a directory that doesn't contain the Dockerfile
  2. The Dockerfile has a different name (e.g., dockerfile in lowercase)

In the main branch the Dockerfile file name is correct so to resolve this, please verify:

  • That you're running the command from the root directory of the project
  • That the file is named exactly Dockerfile (case-sensitive)

If your Dockerfile has a different name, you can specify it using the -f flag:

docker buildx build --platform linux/amd64,linux/arm64 -t readme-ai --push -f ./your-dockerfile .

The command structure itself is correct for multi-architecture builds. Once you confirm the Dockerfile location and name, it should work as expected.

Let me know if you need any further assistance! If not, this issue can be closed @eli64s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants