basecamp / kamal

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

Kamal with 'multiarch false' setup ends with docker exit status 256 - the image does not exist locally #771

Closed abratashov closed 1 month ago

abratashov commented 2 months ago

I've added this setting to deploy.yml:

builder:
  multiarch: false

When try to set up server, it fails with error An image does not exist locally with the tag: registry.gitlab.com/user/my-app/my-app-demo

Full log:

kamal setup -d demo
 ...

docker build -t registry.gitlab.com/user/my-app/my-app-demo:ac0662f5f2ac4fd0766375c0a601f377acb89962_uncommitted_71a99c5fce56c9d5 -t registry.gitlab.com/user/my-app/my-app-demo:latest --label service="my-app-demo" --file Dockerfile . && docker push registry.gitlab.com/user/my-app/my-app-demo:ac0662f5f2ac4fd0766375c0a601f377acb89962_uncommitted_71a99c5fce56c9d5 && docker push registry.gitlab.com/user/my-app/my-app-demo:latest

#0 building with "kamal-my-app-demo-multiarch" instance using docker-container driver
...
#21 [stage-2 4/4] RUN useradd rails --create-home --shell /bin/bash &&     chown -R rails:rails db log public storage tmp
#21 CACHED
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
The push refers to repository [registry.gitlab.com/user/my-app/my-app-demo]
An image does not exist locally with the tag: registry.gitlab.com/user/my-app/my-app-demo

Finished all in 32.5 seconds
ERROR (SSHKit::Command::Failed): docker exit status: 256
docker stdout: The push refers to repository [registry.gitlab.com/user/my-app/my-app-demo]
docker stderr: #0 building with "kamal-my-app-demo-multiarch" instance using docker-container driver

Kamal: 1.4.0 Docker: 24.0.5 Ubuntu: 22.04

abratashov commented 2 months ago

Solved this issue by changes from:

builder:
  multiarch: false

=>

builder:
  cache:
    type: registry
  remote:
    arch: amd64

As result, Kamal runs it with a correct docker command:

docker buildx build --push --platform linux/amd64 --builder kamal-my-app-demo-native-remote -t registry.gitlab.com/user/my-app/my-app-demo:0a2e408b9e77d6e5e4a9c73be0ccd232edf4b6c5_uncommitted_026c0b9acf253cef -t registry.gitlab.com/user/my-app/my-app-demo:latest --cache-to type=registry,ref=registry.gitlab.com/user/my-app/my-app-demo-build-cache --cache-from type=registry,ref=registry.gitlab.com/user/my-app/my-app-demo-build-cache --label service="my-app-demo" --file Dockerfile .

So, I left this ticket open, because as I see multiarch: false doesn't work correctly.


CPU architecture: uname -m My machine: x86_64 Host: x86_64

dhh commented 1 month ago

I think something else is at play. I just built a new app using multiarch: false. Seems like maybe it's related to the registry. Feel free to open another ticket if you pin it down further, but I can't replicate it as-is.

abratashov commented 1 month ago

Yes, sure!

P.S. David, thank you for empowering your great dreams! We've just successfully migrated from the hundred Ansible scripts into the few files of Kamal, it works, and it's fantastic!