In some cases it is more cost-effective to use a managed third-party builder to speed up your image building process in a Kamal deployment. There are new products that offer powerful optimized builders, such as:
If you are interested in setup and tune your own builder, there are great examples in Kamal Docker Build Cloud in your account
GitHub Action
Note the configuration in docker/setup-buildx-action@v3
name: Workflow - Deployment
on:
push:
branches:
- main
jobs:
deploy:
name: kamal deploy
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.KAMAL_REGISTRY_USERNAME }}
password: ${{ secrets.KAMAL_REGISTRY_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: "your-org/builder-name"
install: true
- run: gem install kamal
- run: kamal lock release
- run: kamal deploy
Kamal configuration
You need to configure docker builder driver in order to pickup the docker environment builder defaults.
builder:
arch: amd64
driver: docker
SOCIAL SHARE CARD GENERATOR