Building
Run pocketone desktop build in your app's folder, the one with pb_hooks, pb_migrations or pb_public. It embeds
those folders in a desktop app for each platform you ask for.
pocketone desktop build # this machine's platform
pocketone desktop build --all # all six below
pocketone desktop build --target windows/amd64,linux/amd64 # some of them
pocketone desktop build --out builds # somewhere other than dist/
pocketone desktop build --no-sign # skip the sign section
| Platform | --target |
You get |
|---|---|---|
| macOS, Apple Silicon | darwin/arm64 |
dist/darwin-arm64/<name>.app and <name>.dmg |
| macOS, Intel | darwin/amd64 |
dist/darwin-amd64/<name>.app and <name>.dmg |
| Windows, x64 | windows/amd64 |
dist/windows-amd64/<name>.exe |
| Windows, Arm | windows/arm64 |
dist/windows-arm64/<name>.exe |
| Linux, x64 | linux/amd64 |
dist/linux-amd64/<name> |
| Linux, Arm | linux/arm64 |
dist/linux-arm64/<name> |
Each is one file (or one .app bundle) of about 40 MB, with your app and PocketOne inside. Windows builds open no
console window.
On a Mac, each macOS build also comes as a .dmg: the app and a link to Applications to drag it onto. With a sign
section in pocketone.yaml, every build is signed for you; see Signing and sharing.
Name and size
pocketone.yaml's desktop section names the app and sizes its window:
desktop:
name: Notes # window title and file name; default: the folder's name
id: dev.example.notes # where each user's data lives; default: app.pocketone.<name>
width: 900 # starting window size; default 1024 × 768
height: 640
Choose the id once and keep it. It names the folder each user's data lives in, so a new id is a new, empty app for
everyone who installed the old one.
The build image
Builds run in Docker, in the build image for your pocketone's version: ghcr.io/pocketonehq/pocketone-build:v<version>,
pulled the first time. It holds Go, PocketOne's source and every dependency, vendored, so once it's here builds work
offline, and the same pocketone version always builds the same app.
pocketone desktop build mounts your app folder and the output folder into it, builds every platform there, and
keeps Go's build cache in a Docker volume (pocketone-build-cache), so rebuilds take seconds. On a Mac it then signs
the macOS bundles ad hoc, so they run on that Mac.
A development pocketone, built from a PocketOne checkout, has no published image. It builds its own,
pocketone-build:dev, from that checkout the first time (a minute or two). pocketone desktop image rebuilds it after
you change the source.
Without Docker
With Go 1.27 or newer and a PocketOne checkout, --local builds with your own Go instead:
pocketone desktop build --local --all # inside the checkout
pocketone desktop build --local --source ~/src/pocketone # anywhere else (or set P1_SOURCE)
It needs no C compiler either: every platform cross-compiles with plain Go.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.