nimbus-eth1/scripts/make_dist.sh
Ștefan Talpalaru 51bc1cf87f
dist: precompiled binaries and Docker images (#1015)
* dist: precompiled binaries and Docker images

The builds are reproducible, the binaries are portable and statically link librocksdb.

This took some patching. Upstream PR: https://github.com/facebook/rocksdb/pull/9752

32-bit ARM is missing as a target because two different GCC versions
fail with an ICE when trying to cross-compile RocksDB. Using Clang
instead is too much trouble for a platform that nobody should be using
anyway.

(Clang doesn't come with its own target headers and libraries, can't be
easily convinced to use the ones from GCC, so it needs an fs image from
a 32-bit ARM distro - at which point I stopped caring).

* CI: disable reproducibility test
2022-03-27 13:21:15 +02:00

43 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2020-2022 Status Research & Development GmbH. Licensed under
# either of:
# - Apache License, version 2.0
# - MIT license
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
# Build release binaries fit for public distribution, using Docker.
# Should be used from "dist-*" Make targets, passing the target architecture's name as a parameter.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"/..
REPO_DIR="${PWD}"
ARCH="${1:-amd64}"
DOCKER_TAG="nimbus-eth1-dist-${ARCH}"
docker rm ${DOCKER_TAG} &>/dev/null || true
cd docker/dist
DOCKER_BUILDKIT=1 \
docker build \
-t ${DOCKER_TAG} \
--progress=plain \
--build-arg USER_ID=$(id -u) \
--build-arg GROUP_ID=$(id -g) \
-f Dockerfile.${ARCH} .
# seccomp can have some serious overhead, so we disable it with "--privileged" - https://pythonspeed.com/articles/docker-performance-overhead/
docker run --privileged --rm --name ${DOCKER_TAG} -v ${REPO_DIR}:/home/user/nimbus-eth1 ${DOCKER_TAG}
cd - &>/dev/null
ls -l dist
# We rebuild everything inside the container, so we need to clean up afterwards.
${MAKE} --no-print-directory clean