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

Duplicate buildkit daemon processes with multi-app deployments #592

Closed
jefvlamings opened this issue Nov 21, 2023 · 0 comments · Fixed by #905
Closed

Duplicate buildkit daemon processes with multi-app deployments #592

jefvlamings opened this issue Nov 21, 2023 · 0 comments · Fixed by #905
Labels

Comments

@jefvlamings
Copy link

When building with Docker (via Kamal) a daemon process buildkitd is spawned. buildkitd is the daemon that runs in the background to handle the build processes. It is responsible for executing build tasks, managing caching, and optimizing the build process. E.g.:

docker buildx build --push --platform linux/arm64 --builder kamal-service-native-remote

The builder tag kamal-service-native-remote is constructed with the name of the service that you've defined in your deploy.yml.

Problem

When you're building multiple different apps on the same build server, you will get a buildkitd for each application. The more apps you have running, the more redundant buildkitd process that keep running. Keep in mind that a buildkitd process takes up a 100's of megabytes.

Screenshot 2023-11-21 at 21 59 33

As far is I understand we could reuse the same daemon process for different application builds. Remotely or locally, this will save up precious RAM.

Solution

Do we need the service name to be part of the builder name in --builder? If so, would it be an option to override it in deploy.yml like:

builder:
  remote:
    arch: arm64
    host: xxx.xxx.xxx.xxx
    name: default

Which would result in

docker buildx build --push --platform linux/arm64 --builder kamal-default-native-remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants