build(docker): add docker build system for palladium core
Add Dockerfile, build script, README and .dockerignore to create a reproducible build environment for Palladium Core binaries. The system builds x86_64 Linux binaries with all required dependencies and outputs them to the out/ directory.
This commit is contained in:
74
docker-build/.dockerignore
Normal file
74
docker-build/.dockerignore
Normal file
@@ -0,0 +1,74 @@
|
||||
# Build outputs
|
||||
out/
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
*.exe
|
||||
|
||||
# Git
|
||||
.git/
|
||||
.gitignore
|
||||
.gitattributes
|
||||
|
||||
# Documentation
|
||||
*.md
|
||||
doc/
|
||||
README*
|
||||
|
||||
# CI/CD
|
||||
.github/
|
||||
.travis.yml
|
||||
.appveyor.yml
|
||||
.cirrus.yml
|
||||
|
||||
# IDE and editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.temp
|
||||
*.log
|
||||
|
||||
# Test files
|
||||
test/
|
||||
src/test/
|
||||
src/bench/
|
||||
|
||||
# Qt files (if not needed for headless build)
|
||||
src/qt/
|
||||
|
||||
# Dependencies cache (will be rebuilt)
|
||||
depends/built/
|
||||
depends/work/
|
||||
depends/sources/
|
||||
|
||||
# Autotools generated files
|
||||
autom4te.cache/
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
Makefile
|
||||
Makefile.in
|
||||
|
||||
# Python cache
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
# Backup files
|
||||
*.bak
|
||||
*.backup
|
||||
26
docker-build/Dockerfile
Normal file
26
docker-build/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
libtool \
|
||||
autotools-dev \
|
||||
automake \
|
||||
autoconf \
|
||||
pkg-config \
|
||||
bsdmainutils \
|
||||
python3 \
|
||||
curl \
|
||||
ca-certificates \
|
||||
git \
|
||||
unzip \
|
||||
zip \
|
||||
file \
|
||||
rsync \
|
||||
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /src
|
||||
CMD ["/bin/bash"]
|
||||
34
docker-build/README.md
Normal file
34
docker-build/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Docker Build System for Palladium Core
|
||||
|
||||
Docker-based build system for creating Palladium Core binaries.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
cd docker-build
|
||||
chmod +x build-linux-x86_64.sh
|
||||
./build-linux-x86_64.sh
|
||||
```
|
||||
|
||||
Binaries will be available in the `out/` directory.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Docker installed and running
|
||||
|
||||
## Produced Binaries
|
||||
|
||||
- `palladiumd`: Main daemon
|
||||
- `palladium-cli`: Command-line client
|
||||
- `palladium-tx`: Transaction utility
|
||||
- `palladium-wallet`: Wallet utility
|
||||
- `palladium-qt`: GUI (if available)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Permission errors:** Use `sudo ./build-linux-x86_64.sh`
|
||||
|
||||
**Build failed:** Run interactive container for debugging:
|
||||
```bash
|
||||
docker run --rm -it -v "$(pwd)":/src palladium-builder:ubuntu20.04 bash
|
||||
```
|
||||
35
docker-build/build-linux-x86_64.sh
Normal file
35
docker-build/build-linux-x86_64.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
IMAGE_NAME="palladium-builder:ubuntu20.04"
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||
OUT_DIR="${SCRIPT_DIR}/out"
|
||||
HOST="x86_64-pc-linux-gnu"
|
||||
|
||||
if ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then
|
||||
docker build -t "$IMAGE_NAME" -f "${SCRIPT_DIR}/Dockerfile" "${SCRIPT_DIR}"
|
||||
fi
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
docker run --rm \
|
||||
-v "${REPO_DIR}":/src \
|
||||
-v "${OUT_DIR}":/out \
|
||||
"$IMAGE_NAME" \
|
||||
bash -c "
|
||||
set -euo pipefail
|
||||
cd /src
|
||||
cd depends && make HOST=${HOST} -j\$(nproc) && cd ..
|
||||
[[ -x ./autogen.sh ]] && ./autogen.sh
|
||||
./configure --prefix=\$PWD/depends/${HOST} \
|
||||
--enable-glibc-back-compat \
|
||||
--enable-reduce-exports \
|
||||
LDFLAGS='-static-libstdc++'
|
||||
make -j\$(nproc)
|
||||
for bin in src/palladiumd src/palladium-cli src/palladium-tx src/palladium-wallet src/qt/palladium-qt; do
|
||||
[[ -f \"\$bin\" ]] && install -m 0755 \"\$bin\" /out/
|
||||
done
|
||||
"
|
||||
|
||||
echo "[*] x86_64 binaries copied to ${OUT_DIR}"
|
||||
Reference in New Issue
Block a user