Skip to content

Commit 2e771f9

Browse files
Building locally works
1 parent b81ec5c commit 2e771f9

11 files changed

Lines changed: 742 additions & 3 deletions

File tree

.github/workflows/docker-plus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
needs: check-trigger
3737
if: needs.check-trigger.outputs.should_build == 'true'
3838
runs-on: ubuntu-latest
39-
timeout-minutes: 60
39+
timeout-minutes: 120
4040
permissions:
4141
contents: write
4242
packages: write

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ yarn-debug.log*
3838
/ee
3939
dump.rdb
4040
*.onnx
41+
42+
# Local build credentials (never commit!)
43+
/deploy/localbuild/keys.yml

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.0.2
1+
2.3.0.3

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.0.2
1+
2.3.0.3

deploy/localbuild/README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Local Docker Build for DocuSeal Plus
2+
3+
Build multi-architecture Docker images (AMD64 + ARM64) locally on your ARM laptop and push to GitHub Container Registry.
4+
5+
## Why Build Locally?
6+
7+
| Build Machine | AMD64 Build | ARM64 Build |
8+
|---------------|-------------|-------------|
9+
| **ARM laptop** | Emulated (works well) | Native (fast) |
10+
| **GitHub Actions** | Native (fast) | Emulated (crashes/timeout) |
11+
12+
Building on an ARM laptop is faster and more reliable for ARM64 images.
13+
14+
## Quick Start
15+
16+
```bash
17+
# Navigate to this folder
18+
cd deploy/localbuild
19+
20+
# 1. One-time setup (installs QEMU and buildx)
21+
./setup.sh
22+
23+
# 2. Copy credentials template and fill in your GitHub PAT
24+
cp keys.template.yml keys.yml
25+
nano keys.yml # Add your GitHub username and PAT
26+
27+
# 3. Login to GHCR
28+
./login-ghcr.sh
29+
30+
# 4. Test build locally (no push)
31+
./build-test.sh
32+
33+
# 5. Build and push release
34+
./build-and-push.sh
35+
```
36+
37+
## Scripts
38+
39+
| Script | Description |
40+
|--------|-------------|
41+
| `setup.sh` | One-time setup for Docker buildx and QEMU |
42+
| `login-ghcr.sh` | Login to GitHub Container Registry |
43+
| `build-test.sh` | Test build locally without pushing |
44+
| `build-and-push.sh` | Interactive build and push to GHCR |
45+
| `reset-builder.sh` | Fix EOF errors by recreating the builder |
46+
47+
## Credentials Setup
48+
49+
1. Create a GitHub Personal Access Token (PAT) at: https://github.com/settings/tokens
50+
2. Required permissions: `write:packages`, `read:packages`
51+
3. Copy `keys.template.yml` to `keys.yml` and fill in your credentials
52+
4. **Never commit `keys.yml`** - it's in `.gitignore`
53+
54+
## Build Options
55+
56+
When running `build-and-push.sh`:
57+
58+
1. **Dev build** - Tags: `dev-YYYYMMDD-SHA` (no version bump)
59+
2. **Latest build** - Tags: `latest` + dev tag (no version bump)
60+
3. **Release build** - Tags: `latest` + base version + full version
61+
- Auto-increments the 4th digit: `2.3.0.1``2.3.0.2`
62+
- Updates the `VERSION` file
63+
64+
## Version Scheme
65+
66+
- `X.Y.Z` - Base DocuSeal version (upstream)
67+
- `X.Y.Z.N` - Plus release number
68+
69+
Example: `2.3.0.2` means DocuSeal 2.3.0 with Plus release #2.
70+
71+
## Build Time
72+
73+
On an ARM laptop (e.g., Surface Pro X, Apple Silicon Mac):
74+
75+
- ARM64 only: ~10-15 minutes (native)
76+
- AMD64 only: ~15-25 minutes (emulated)
77+
- Both architectures: ~25-40 minutes
78+
79+
## Troubleshooting
80+
81+
### "Error: Buildx not set up"
82+
Run `./setup.sh` first.
83+
84+
### "Invalid github_pat in keys.yml"
85+
Make sure you've copied `keys.template.yml` to `keys.yml` and filled in your actual GitHub PAT.
86+
87+
### EOF error / "failed to receive status: rpc error"
88+
This happens when the buildx daemon connection times out during long emulated builds.
89+
90+
**Fix:** Reset the builder:
91+
```bash
92+
./reset-builder.sh
93+
```
94+
95+
Or manually:
96+
```bash
97+
docker buildx rm multiarch
98+
./setup.sh
99+
```
100+
101+
Then retry your build. The `build-test.sh` script also has an option 4 that does this automatically.
102+
103+
### Build crashes or hangs
104+
Try building single architecture first with `./build-test.sh` to identify which platform has issues.
105+
106+
### Permission denied
107+
Make sure scripts are executable: `chmod +x *.sh`
108+
109+
### WSL-specific issues
110+
If builds fail on WSL, make sure:
111+
1. Docker Desktop is running in Windows
112+
2. WSL integration is enabled in Docker Desktop settings
113+
3. You have enough disk space (builds can use 10-20GB temporarily)

0 commit comments

Comments
 (0)