Skip to content

Add docker support and github CR package workflow#167

Merged
yimsk merged 2 commits intoclawscli:mainfrom
stefan-matic:main
Feb 23, 2026
Merged

Add docker support and github CR package workflow#167
yimsk merged 2 commits intoclawscli:mainfrom
stefan-matic:main

Conversation

@stefan-matic
Copy link
Copy Markdown
Contributor

@stefan-matic stefan-matic commented Feb 22, 2026

Summary:

  • Add multi-stage Dockerfile that builds a static Go binary and packages it into a minimal Alpine image (~60MB)
  • Add .dockerignore to keep the build context lean
  • Add .github/workflows/docker.yml that builds multi-arch images (amd64/arm64) and publishes to GitHub Container Registry on pushes to main and version tags

Usage:

  docker run -it --rm \
    -v ~/.aws:/home/claws/.aws:ro \
    ghcr.io/clawscli/claws

Setup:

No manual configuration is required — the workflow uses the built-in GITHUB_TOKEN which has packages: write permission. After the first image is published, you may want to change the package visibility from private to public in the
https://github.com/orgs/clawscli/packages

Note on multi-arch builds:

The workflow currently builds for both linux/amd64 and linux/arm64. On free-tier GitHub Actions runners, the arm64 build runs under QEMU emulation which can take 30-45+ minutes. If build times are a concern, you could:

a. Remove linux/arm64 from the platforms list to build amd64 only
b. Use native arm64 runners (e.g. ubuntu-24.04-arm, available on paid plans or for public repos)
c. Use cross-compilation instead of QEMU — Go natively cross-compiles without emulation. This requires restructuring the Dockerfile to build outside Docker and copy the binary in, which loses the multi-stage simplicity.

@yimsk
Copy link
Copy Markdown
Contributor

yimsk commented Feb 23, 2026

Thanks for this, looks great!

Since claws is pure Go (CGO_ENABLED=0), I think we can avoid QEMU entirely by using Go's native cross-compilation. Something like this:

FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build

WORKDIR /src

COPY go.mod go.sum ./
RUN go mod download

COPY . .

ARG VERSION=dev
ARG TARGETOS TARGETARCH

RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
    -ldflags="-s -w -X main.version=${VERSION}" \
    -o /claws ./cmd/claws

This way we wouldn't need to rely on QEMU at all.
k9s uses the same approach: https://github.com/derailed/k9s/blob/master/Dockerfile

@stefan-matic
Copy link
Copy Markdown
Contributor Author

Yeah that sounds sane, lemme rework it

@stefan-matic
Copy link
Copy Markdown
Contributor Author

stefan-matic commented Feb 23, 2026

Yup, you're right that's a lot faster (even disregarding the cache)!

Previously:
image

With the cross-compilation:
image

Thanks for teaching me something new :)

@yimsk yimsk merged commit d806a8e into clawscli:main Feb 23, 2026
3 of 4 checks passed
@yimsk
Copy link
Copy Markdown
Contributor

yimsk commented Feb 23, 2026

This is awesome, thank you! 🎉
47min → 9min is a huge improvement. Merged and the image is now published at ghcr.io/clawscli/claws.

@yimsk yimsk mentioned this pull request Feb 24, 2026
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 24, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [github:clawscli/claws](https://github.com/clawscli/claws) | patch | `0.15.0` → `0.15.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>clawscli/claws (github:clawscli/claws)</summary>

### [`v0.15.1`](https://github.com/clawscli/claws/releases/tag/v0.15.1)

[Compare Source](clawscli/claws@v0.15.0...v0.15.1)

#### Changelog

- [`4fe75b6`](clawscli/claws@4fe75b6) Add docker support and github CR package workflow
- [`92189e5`](clawscli/claws@92189e5) Cross-compile for multiple archs instead of relying on QEMU
- [`63731ed`](clawscli/claws@63731ed) Merge pull request [#&#8203;165](clawscli/claws#165) from clawscli/develop
- [`d806a8e`](clawscli/claws@d806a8e) Merge pull request [#&#8203;167](clawscli/claws#167) from stefan-matic/main
- [`f508583`](clawscli/claws@f508583) Merge pull request [#&#8203;168](clawscli/claws#168) from clawscli/develop
- [`7fbf05d`](clawscli/claws@7fbf05d) Merge pull request [#&#8203;169](clawscli/claws#169) from dpalvolgyi-pw/feature/ecs-last-deployment
- [`87d9644`](clawscli/claws@87d9644) Merge pull request [#&#8203;170](clawscli/claws#170) from clawscli/develop
- [`6d22155`](clawscli/claws@6d22155) feat(ecs): add last deployment column

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zMS4xIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
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

Successfully merging this pull request may close these issues.

2 participants