2025-06-29 11:45:12 +02:00
|
|
|
#!/bin/sh
|
2025-11-13 17:58:52 +00:00
|
|
|
set -eu
|
2025-06-29 11:45:12 +02:00
|
|
|
|
2025-07-28 00:05:28 +02:00
|
|
|
# Example usage: ./build.sh v4.9
|
2025-06-29 11:45:12 +02:00
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2025-11-13 17:51:14 +00:00
|
|
|
repo_root="$(cd ../../.. && pwd)"
|
2025-11-14 21:45:27 +00:00
|
|
|
checkout_ref="$(git -C "$repo_root" rev-parse HEAD)"
|
2025-11-13 17:51:14 +00:00
|
|
|
|
2025-11-13 18:00:19 +00:00
|
|
|
if [ "${2:-}" ]; then
|
2025-07-28 00:05:28 +02:00
|
|
|
cpu_set="--cpuset-cpus $2"
|
|
|
|
|
else
|
|
|
|
|
cpu_set=""
|
|
|
|
|
fi
|
|
|
|
|
|
2025-11-14 21:45:27 +00:00
|
|
|
docker build $cpu_set \
|
|
|
|
|
--build-arg P2POOL_VERSION=$1 \
|
|
|
|
|
--build-arg P2POOL_CHECKOUT=$checkout_ref \
|
|
|
|
|
-t p2pool_linux_x64_build_$1 \
|
|
|
|
|
-f Dockerfile "$repo_root"
|
2025-06-29 11:45:12 +02:00
|
|
|
|
2025-07-11 17:26:51 +02:00
|
|
|
docker create --name p2pool_linux_x64_build_$1_container p2pool_linux_x64_build_$1:latest
|
|
|
|
|
docker cp p2pool_linux_x64_build_$1_container:/p2pool/build/p2pool-$1-linux-x64.tar.gz ../p2pool-$1-linux-x64.tar.gz
|
|
|
|
|
docker rm p2pool_linux_x64_build_$1_container
|
2025-06-29 11:45:12 +02:00
|
|
|
|
2025-07-11 17:26:51 +02:00
|
|
|
docker image rm -f p2pool_linux_x64_build_$1
|