122 lines
3.5 KiB
Markdown
122 lines
3.5 KiB
Markdown
|
|
# PalladiumWallet — Reproducible Builds via Docker
|
|||
|
|
|
|||
|
|
All three distribution targets (Windows, Linux, Android) are built inside
|
|||
|
|
Docker containers so the output is identical regardless of what is installed
|
|||
|
|
on the host machine.
|
|||
|
|
|
|||
|
|
**Prerequisites:** Docker Engine (or Docker Desktop) running on the host.
|
|||
|
|
No .NET SDK, JDK, or Android SDK required on the host.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Quick start
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
# From the repository root (or the docker/ folder — both work):
|
|||
|
|
./docker/build.sh
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
Running without arguments shows an interactive menu. Pick a target or `all`.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## CLI usage
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
./docker/build.sh [TARGET] [--rebuild]
|
|||
|
|
|
|||
|
|
Targets:
|
|||
|
|
windows Win x64 single-file executable
|
|||
|
|
linux Linux x64 self-contained tarball
|
|||
|
|
android Android APK (debug-signed)
|
|||
|
|
all All three targets
|
|||
|
|
|
|||
|
|
Options:
|
|||
|
|
--rebuild Force rebuild of Docker images (needed after Dockerfile changes)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### Examples
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
# Build everything
|
|||
|
|
./docker/build.sh all
|
|||
|
|
|
|||
|
|
# Windows only
|
|||
|
|
./docker/build.sh windows
|
|||
|
|
|
|||
|
|
# Android, forcing a fresh Docker image
|
|||
|
|
./docker/build.sh android --rebuild
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Output
|
|||
|
|
|
|||
|
|
All artifacts land in `dist/` at the repository root:
|
|||
|
|
|
|||
|
|
| Target | Path |
|
|||
|
|
|---------|--------------------------------------------------|
|
|||
|
|
| Windows | `dist/windows/PalladiumWallet-{ver}-win-x64.exe` |
|
|||
|
|
| Linux | `dist/linux/PalladiumWallet-{ver}-linux-x64.tar.gz` |
|
|||
|
|
| Android | `dist/android/PalladiumWallet-{ver}.apk` |
|
|||
|
|
|
|||
|
|
The version is read automatically from `src/App/PalladiumWallet.App.csproj`.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Docker images
|
|||
|
|
|
|||
|
|
| Image name | Dockerfile | Used for | Approx. size |
|
|||
|
|
|---------------------|-----------------------|--------------------|--------------|
|
|||
|
|
| `plm-build-desktop` | `Dockerfile.desktop` | windows + linux | ~1.5 GB |
|
|||
|
|
| `plm-build-android` | `Dockerfile.android` | android | ~5 GB |
|
|||
|
|
|
|||
|
|
Images are built automatically on first use and reused on subsequent runs.
|
|||
|
|
Use `--rebuild` only after you modify a Dockerfile.
|
|||
|
|
|
|||
|
|
### NuGet package cache
|
|||
|
|
|
|||
|
|
A Docker named volume `plm-nuget-cache` is created on first run and reused
|
|||
|
|
for all subsequent builds, so NuGet packages are not re-downloaded every time.
|
|||
|
|
|
|||
|
|
To inspect or remove it:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
docker volume inspect plm-nuget-cache
|
|||
|
|
docker volume rm plm-nuget-cache # forces full re-download on next build
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Source isolation
|
|||
|
|
|
|||
|
|
The repository is mounted **read-only** inside every container. The build
|
|||
|
|
commands work on a copy at `/tmp/build`, so `bin/`, `obj/`, and other
|
|||
|
|
generated files never appear in your working tree.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Android notes
|
|||
|
|
|
|||
|
|
The `plm-build-android` image bakes in the entire Android SDK and the
|
|||
|
|
`dotnet android workload` (~5 GB total). The first `docker build` for this
|
|||
|
|
image can take 10–20 minutes depending on network speed.
|
|||
|
|
|
|||
|
|
The resulting APK is **debug-signed** (suitable for sideloading during
|
|||
|
|
development). For Play Store distribution, release signing must be configured
|
|||
|
|
separately.
|
|||
|
|
|
|||
|
|
If the `commandlinetools` URL in `Dockerfile.android` becomes stale (Google
|
|||
|
|
rotates the build number), update the URL to the latest
|
|||
|
|
[Android command-line tools](https://developer.android.com/studio#command-tools)
|
|||
|
|
and run `./docker/build.sh android --rebuild`.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Linux AppImage (future)
|
|||
|
|
|
|||
|
|
The Linux target currently produces a self-contained binary tarball. Once a
|
|||
|
|
`pupnet.conf` is added to the repository, the `build_linux` function in
|
|||
|
|
`build.sh` can be extended to call `dotnet pupnet --runtime linux-x64` inside
|
|||
|
|
the same `plm-build-desktop` image to produce an AppImage.
|