basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
10.6k stars 408 forks source link

failed to read dockerfile: open Dockerfile: no such file or directory with Kamal 2 and Rails 8 template #1012

Closed intik closed 2 days ago

intik commented 3 days ago

Hi,

I´m trying simple deploy of base app with Kamal 2 and Rails 8 template.

When running kamal deploy -v in app folder I see some success steps of login on my machine, login on host machine, checking/installing docker on host, cloning of app into local tmp directory. Last successful command is docker buildx inspect kamal-local-docker-container.

Then it runs command docker buildx build --push --platform linux/amd64 --builder kamal-local-docker-container -t xxx/xxx:xxx -t xxx/xxx:latest --label service="xxx" --file Dockerfile . which fails with:

#0 building with "kamal-local-docker-container" instance using docker-container driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2B done
#1 DONE 0.0s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

I checked both the origin app directory and the /tmp/kamal-clones/xxx/ directory and both are containing the same Dockerfile file.

Could it be because of some wrong configuration or a bug?

Thanks

gorbulls456667 commented 3 days ago

I get the same error when running kamal setup for a Dockerized Next.js application. failed to read dockerfile: open Dockerfile: no such file or directory

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 2B 0.0s done
#2 DONE 0.1s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

When I run docker build -t nextjs-docker . and then docker run -p 3000:3000 nextjs-docker it works fine locally. But I get this error when I runkamal setup: ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

djmb commented 3 days ago

@gorbulls456667 - have you committed the Dockerfile? @intik - I guess you probably have if it's in /tmp/kamal-clones/xxx/.

Could you run kamal build remove and try again? That will remove and recreate the builder.

intik commented 2 days ago

After more digging I got a feeling that my Docker installation wasnt´t correct although it worked for local user.

I´ve reinstalled Docker with https://docs.docker.com/engine/install/ubuntu/ and now the kamal deploy works!

Sorry for the false alarm and thanks.