Compare commits
37 Commits
master
...
add-jenkin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dcc62a321 | ||
|
|
414105427b | ||
|
|
ad13bb75d8 | ||
|
|
4bb08626b7 | ||
|
|
e644953647 | ||
|
|
fcf76f934b | ||
|
|
a97f82b3f9 | ||
|
|
6cbd66206f | ||
|
|
c95700413a | ||
|
|
1675e5ae47 | ||
|
|
00f7f83ac8 | ||
|
|
b2ea24e4f3 | ||
|
|
917f2e28aa | ||
|
|
36fadd90a7 | ||
|
|
a6b73dda8c | ||
|
|
c7642e1f18 | ||
|
|
b13663fad7 | ||
|
|
0d0ae1229f | ||
|
|
0d6cc04d35 | ||
|
|
7aba573321 | ||
|
|
e780e7afd1 | ||
|
|
f83cf7979a | ||
|
|
ac0c3be923 | ||
|
|
91b6717f0a | ||
|
|
f916662d90 | ||
|
|
648ef4ee66 | ||
|
|
1f1aa556e1 | ||
|
|
fc380599f2 | ||
|
|
1a00a68fbe | ||
|
|
687fa65b05 | ||
|
|
e18cfb58a1 | ||
|
|
0390f1b8e6 | ||
|
|
0e6275c72f | ||
|
|
05b9e57000 | ||
|
|
2bc89d5ad2 | ||
|
|
404c175fa2 | ||
|
|
5fbf64be58 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -141,4 +141,5 @@ contrib/devtools/split-debug.sh
|
||||
|
||||
osx_volname
|
||||
dist/
|
||||
*.background.tiff
|
||||
*.background.tiff
|
||||
.Trash*
|
||||
|
||||
11
Jenkinsfile
vendored
Normal file
11
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
pipeline {
|
||||
agent { label 'master' }
|
||||
stages {
|
||||
stage('build') {
|
||||
when { changeset pattern: "src/*", caseSensitive: true }
|
||||
steps {
|
||||
sh "contrib/docker/build.sh -o x86_64-linux-gnu blackcoinnl github CoinBlack" + env.GIT_LOCAL_BRANCH + " Etc/UTC"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
contrib/docker/.gitignore
vendored
Normal file
7
contrib/docker/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
aarch64-linux-gnu/aarch64-linux-gnu/*
|
||||
aarch64-linux-gnu/parts/*
|
||||
arm-linux-gnueabihf/arm-linux-gnueabihf/*
|
||||
arm-linux-gnueabihf/parts/*
|
||||
x86_64-linux-gnu/x86_64-linux-gnu/*
|
||||
x86_64-linux-gnu/parts/*
|
||||
depends*.*xz
|
||||
10
contrib/docker/README.md
Executable file
10
contrib/docker/README.md
Executable file
@@ -0,0 +1,10 @@
|
||||
## To Build
|
||||
|
||||
#### Log in to [Docker Hub](https://hub.docker.com).
|
||||
|
||||
`docker login`
|
||||
|
||||
#### Build
|
||||
|
||||
`moreBuilder/build.sh`
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
FROM ubuntu AS ubase-base-aarch64-linux-gnu
|
||||
ARG BRANCH
|
||||
ENV BRANCH=$BRANCH
|
||||
ARG TIMEZONE
|
||||
ENV TIMEZONE=$TZ
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && apt-get install -yqq \
|
||||
git \
|
||||
make \
|
||||
file \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
libevent-dev \
|
||||
build-essential \
|
||||
autotools-dev \
|
||||
pkg-config \
|
||||
bsdmainutils \
|
||||
python3 \
|
||||
libevent-dev \
|
||||
libboost-all-dev \
|
||||
libminiupnpc-dev \
|
||||
libzmq3-dev \
|
||||
libssl-dev \
|
||||
gperf \
|
||||
wget \
|
||||
# blk commandline utility
|
||||
jq \
|
||||
bc \
|
||||
# cross compile arm
|
||||
g++-arm-linux-gnueabihf \
|
||||
binutils-arm-linux-gnueabihf \
|
||||
# cross compile aarch64
|
||||
g++-aarch64-linux-gnu \
|
||||
binutils-aarch64-linux-gnu \
|
||||
# cross compile macOS
|
||||
curl \
|
||||
librsvg2-bin \
|
||||
libtiff-tools \
|
||||
bsdmainutils \
|
||||
cmake \
|
||||
imagemagick \
|
||||
libcap-dev \
|
||||
libz-dev \
|
||||
libbz2-dev \
|
||||
python3-setuptools \
|
||||
libtinfo5
|
||||
|
||||
|
||||
FROM ubase-base-aarch64-linux-gnu AS ubase-aarch64-linux-gnu
|
||||
|
||||
RUN git clone -b $BRANCH https://github.com/CoinBlack/blackcoin-more.git
|
||||
|
||||
|
||||
COPY aarch64-linux-gnu ./aarch64-linux-gnu
|
||||
WORKDIR /blackcoin-more
|
||||
RUN (git clean -xf && \
|
||||
./autogen.sh && \
|
||||
./configure --prefix=/aarch64-linux-gnu --enable-glibc-back-compat --enable-reduce-exports --disable-tests --disable-bench --disable-gui-tests --enable-upnp-default LDFLAGS=-static-libstdc++ && \
|
||||
make -j4 && \
|
||||
make install && \
|
||||
cd src/ && \
|
||||
/usr/bin/aarch64-linux-gnu-strip blackmore*)
|
||||
|
||||
RUN cp /blackcoin-more/src/blackmored /usr/local/bin/ && \
|
||||
cp /blackcoin-more/src/blackmore-cli /usr/local/bin/ && \
|
||||
cp /blackcoin-more/contrib/blk /usr/local/bin/
|
||||
WORKDIR /aarch64-linux-gnu/parts
|
||||
RUN cp --parents /usr/local/bin/blk ./ && \
|
||||
cp --parents /usr/local/bin/blackmored ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmored | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp --parents /usr/local/bin/blackmore-cli ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmore-cli | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp /usr/bin/bc --parents ./ && \
|
||||
cp /usr/bin/jq --parents ./
|
||||
WORKDIR /
|
||||
RUN ls /blackcoin-more/src | grep blackmore && ls /usr/local/bin && ls /aarch64-linux-gnu/parts/usr
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM ubase-aarch64-linux-gnu AS ubuntu-aarch64-linux-gnu
|
||||
|
||||
# Collect dependencies
|
||||
|
||||
FROM ubuntu
|
||||
ENV TZ=America/Los_Angeles
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && \
|
||||
apt-get -yqq upgrade && \
|
||||
apt-get -yqq install \
|
||||
libboost-all-dev \
|
||||
libzmq3-dev \
|
||||
libminiupnpc-dev
|
||||
|
||||
# Copy the binaries to our new container
|
||||
COPY --from=ubase-aarch64-linux-gnu /blackcoin-more/src/blackmored /usr/local/bin
|
||||
COPY --from=ubase-aarch64-linux-gnu /blackcoin-more/src/blackmore-cli /usr/local/bin
|
||||
COPY --from=ubase-aarch64-linux-gnu /usr/bin/bc /usr/bin
|
||||
COPY --from=ubase-aarch64-linux-gnu /usr/bin/jq /usr/bin
|
||||
|
||||
# Expose the port for the RPC interface
|
||||
EXPOSE 15714/tcp
|
||||
@@ -0,0 +1,74 @@
|
||||
FROM ubuntu AS ubase-base-arm-linux-gnueabihf
|
||||
ARG BRANCH
|
||||
ENV BRANCH=$BRANCH
|
||||
ARG TIMEZONE
|
||||
ENV TIMEZONE=$TZ
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && apt-get install -yqq \
|
||||
git \
|
||||
make \
|
||||
file \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
libevent-dev \
|
||||
build-essential \
|
||||
autotools-dev \
|
||||
pkg-config \
|
||||
bsdmainutils \
|
||||
python3 \
|
||||
libevent-dev \
|
||||
libboost-all-dev \
|
||||
libminiupnpc-dev \
|
||||
libzmq3-dev \
|
||||
libssl-dev \
|
||||
gperf \
|
||||
wget \
|
||||
# blk commandline utility
|
||||
jq \
|
||||
bc \
|
||||
# cross compile arm
|
||||
g++-arm-linux-gnueabihf \
|
||||
binutils-arm-linux-gnueabihf \
|
||||
# cross compile aarch64
|
||||
g++-aarch64-linux-gnu \
|
||||
binutils-aarch64-linux-gnu \
|
||||
# cross compile macOS
|
||||
curl \
|
||||
librsvg2-bin \
|
||||
libtiff-tools \
|
||||
bsdmainutils \
|
||||
cmake \
|
||||
imagemagick \
|
||||
libcap-dev \
|
||||
libz-dev \
|
||||
libbz2-dev \
|
||||
python3-setuptools \
|
||||
libtinfo5
|
||||
|
||||
FROM ubase-base-arm-linux-gnueabihf AS ubase-arm-linux-gnueabihf
|
||||
|
||||
RUN git clone -b $BRANCH https://github.com/CoinBlack/blackcoin-more.git
|
||||
|
||||
COPY arm-linux-gnueabihf ./arm-linux-gnueabihf
|
||||
WORKDIR /blackcoin-more
|
||||
RUN (git clean -xf && \
|
||||
./autogen.sh && \
|
||||
./configure --prefix=/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports --disable-tests --disable-bench --disable-gui-tests --enable-upnp-default LDFLAGS=-static-libstdc++ && \
|
||||
make -j4 && \
|
||||
make install && \
|
||||
cd src/ && \
|
||||
/usr/bin/arm-linux-gnueabihf-strip blackmore*)
|
||||
|
||||
RUN cp /blackcoin-more/src/blackmored /usr/local/bin/ && \
|
||||
cp /blackcoin-more/src/blackmore-cli /usr/local/bin/ && \
|
||||
cp /blackcoin-more/contrib/blk /usr/local/bin/
|
||||
WORKDIR /arm-linux-gnueabihf/parts
|
||||
RUN cp --parents /usr/local/bin/blk ./ && \
|
||||
cp --parents /usr/local/bin/blackmored ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmored | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp --parents /usr/local/bin/blackmore-cli ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmore-cli | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp /usr/bin/bc --parents ./ && \
|
||||
cp /usr/bin/jq --parents ./
|
||||
WORKDIR /
|
||||
@@ -0,0 +1,22 @@
|
||||
FROM ubase-arm-linux-gnueabihf AS ubuntu-arm-linux-gnueabihf
|
||||
|
||||
# Collect dependencies
|
||||
|
||||
FROM ubuntu
|
||||
ENV TZ=America/Los_Angeles
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && \
|
||||
apt-get -yqq upgrade && \
|
||||
apt-get -yqq install \
|
||||
libboost-all-dev \
|
||||
libzmq3-dev \
|
||||
libminiupnpc-dev
|
||||
|
||||
# Copy the binaries from to our new container
|
||||
COPY --from=ubase-arm-linux-gnueabihf /blackcoin-more/src/blackmored /usr/local/bin
|
||||
COPY --from=ubase-arm-linux-gnueabihf /blackcoin-more/src/blackmore-cli /usr/local/bin
|
||||
COPY --from=ubase-arm-linux-gnueabihf /usr/bin/bc /usr/bin
|
||||
COPY --from=ubase-arm-linux-gnueabihf /usr/bin/jq /usr/bin
|
||||
|
||||
# Expose the port for the RPC interface
|
||||
EXPOSE 15714/tcp
|
||||
185
contrib/docker/build.sh
Executable file
185
contrib/docker/build.sh
Executable file
@@ -0,0 +1,185 @@
|
||||
#!/bin/bash
|
||||
[[ -z `echo $PWD | grep jenkins_home` ]] && BASE_DIR=$(dirname $(realpath $0 )) || BASE_DIR="${WORKSPACE}/contrib/docker"
|
||||
Alist="\n
|
||||
\t \t \t \t aarch64-linux-gnu \t (eg. Raspi4 with Ubuntu) \n
|
||||
\t \t \t \t arm-linux-gnueabihf \t (eg. Other Raspi) \n
|
||||
\t \t \t \t x86_64-linux-gnu \t (aka. Linux AMD64) \n
|
||||
\t \t \t \t all \t (only works in option mode) \n
|
||||
"
|
||||
|
||||
usage="Usage: \n
|
||||
\t option mode: \t \`build.sh -o <architecture> <DockerHub> <HubLab> <GitAccount> <BRANCH> <TIMEZONE>\` \n
|
||||
\t interactive: \t \`build.sh -i\` \n
|
||||
\t \t \t help: \t \`build.sh -h\` \n
|
||||
\n Architectures: ${Alist} \n
|
||||
"
|
||||
|
||||
h1="<architecture> \t Choose your architecture. ${Alist}"
|
||||
h2="<DockerHub> \t \t Enter your Docker Hub Account name."
|
||||
h3="<HubLab> \t \t \t Enter \"github\" or \"gitlab\"."
|
||||
h4="<GitAccount> \t Enter the git account name. (eg. \"CoinBlack\" on GitHub, or \"blackcoin\" on GitLab)"
|
||||
h5="<BRANCH> \t \t \t Enter the BRANCH name. (eg. master)"
|
||||
h6="<TIMEZONE> \t \t Enter your timezone. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)"
|
||||
|
||||
help=" \n
|
||||
\t The defaults in interactive mode, written in for option mode: \n
|
||||
build.sh -o x86_64-linux-gnu blackcoinnl github CoinBlack v2.13.2.7 America/Los_Angeles \n
|
||||
\n $h1 \n
|
||||
\n $h2 \n
|
||||
\n $h3 \n
|
||||
\n $h4 \n
|
||||
\n $h5 \n
|
||||
\n $h6 \n
|
||||
"
|
||||
|
||||
case $1 in
|
||||
|
||||
-h)
|
||||
echo -e ${help}
|
||||
;;
|
||||
|
||||
-i|-o)
|
||||
|
||||
# Questions for Interactive Mode
|
||||
|
||||
defaultARCH=${2:-x86_64-linux-gnu}
|
||||
defaultDockerHub=${3:-blackcoinnl}
|
||||
defaultHubLab=${4:-github}
|
||||
defaultRepo=${5:-CoinBlack}
|
||||
defaultBranch=${6:-v2.13.2.7}
|
||||
defaultTimezone=${7:-America/Los_Angeles}
|
||||
if [[ $1 == -i ]]; then
|
||||
echo -e ${Alist}
|
||||
read -p "For what architecture would you like to build? ($defaultARCH): " architecture
|
||||
read -p "What is your DockerHub Account Name? ($defaultDockerHub): " DockerHub
|
||||
read -p "Github or Gitlab? ($defaultHubLab): " HubLab
|
||||
read -p "What is your GitAccount name? ($defaultRepo): " GitAccount
|
||||
read -p "What BRANCH/version? ($defaultBranch): " BRANCH
|
||||
read -p "What is your TIMEZONE? (${defaultTimezone}): " TIMEZONE
|
||||
echo "Architecture: ${architecture}"
|
||||
echo "DockerHub Account: ${DockerHub}"
|
||||
echo "Git Account: ${HubLab}.com/${GitAccount} ${BRANCH}"
|
||||
echo "Timezone: ${TIMEZONE}"
|
||||
else
|
||||
echo -e "
|
||||
Option Mode! \n
|
||||
Architecture: $2
|
||||
DockerHub Account: $3
|
||||
Git Account: https://${4}.com/${5} ${6}
|
||||
Timezone: ${7}
|
||||
"
|
||||
fi
|
||||
|
||||
# Architecture
|
||||
|
||||
|
||||
architecture=${architecture:-${defaultARCH}}
|
||||
if [[ ${architecture} == all ]]; then
|
||||
bash ${BASE_DIR}/build.sh -o aarch64-linux-gnu $3 $4 $5 $6 $7
|
||||
bash ${BASE_DIR}/build.sh -o arm-linux-gnueabihf $3 $4 $5 $6 $7
|
||||
bash ${BASE_DIR}/build.sh -o x86_64-linux-gnu $3 $4 $5 $6 $7
|
||||
exit 0
|
||||
else
|
||||
[[ ${architecture} != ${defaultARCH} ]] && sed -i "s/-x86_64-linux-gnu/-${architecture}/" $0
|
||||
|
||||
# Download Dependencies
|
||||
|
||||
if [[ -f ${BASE_DIR}/depends-${architecture}.tar.xz && -f ${BASE_DIR}/${architecture}/${architecture}/bin/fc-cache ]]; then
|
||||
echo "Dependencies exist! Checking sha256sum!";
|
||||
|
||||
case $architecture in
|
||||
aarch64-linux-gnu)
|
||||
checkSUM=`echo "f6f1b099d876db90396d0d56eb5b3f366f14c90e077524e2b10bfdaaa1aa5805 ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK!" || exit 1
|
||||
;;
|
||||
arm-linux-gnueabihf)
|
||||
checkSUM=`echo "339c1159adcccecb45155b316f1f5772009b92acb8cfed29464dd7f09775fb79 ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK!" || exit 1
|
||||
;;
|
||||
x86_64-linux-gnu)
|
||||
checkSUM=`echo "eed063b26f4c4e0fa35dc085fe09bafd4251cffa76cdabb26bf43077da03b84e ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK!" || exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
[[ -z `which wget` ]] && apt-get install wget
|
||||
/usr/bin/wget -qO ${BASE_DIR}/depends-${architecture}.tar.xz https://admin.blackcoin.nl/static/depends-${architecture}.tar.xz
|
||||
|
||||
case $architecture in
|
||||
aarch64-linux-gnu)
|
||||
platform="linux/arm64, linux/arm/v8"
|
||||
checkSUM=`echo "f6f1b099d876db90396d0d56eb5b3f366f14c90e077524e2b10bfdaaa1aa5805 ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|
||||
|| exit 1
|
||||
;;
|
||||
arm-linux-gnueabihf)
|
||||
platform="linux/arm/v7"
|
||||
checkSUM=`echo "339c1159adcccecb45155b316f1f5772009b92acb8cfed29464dd7f09775fb79 ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|
||||
|| exit 1
|
||||
;;
|
||||
x86_64-linux-gnu)
|
||||
platform="linux/amd64"
|
||||
checkSUM=`echo "eed063b26f4c4e0fa35dc085fe09bafd4251cffa76cdabb26bf43077da03b84e ${BASE_DIR}/depends-${architecture}.tar.xz" | sha256sum --check | awk '{print $2}' 2> /dev/null`
|
||||
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|
||||
|| exit 1
|
||||
;;
|
||||
esac
|
||||
echo -e "
|
||||
Dependencies SHA256SUM GOOD!
|
||||
"
|
||||
fi
|
||||
|
||||
|
||||
# DockerHub Account
|
||||
|
||||
DockerHub=${DockerHub:-${defaultDockerHub}}
|
||||
[[ $DockerHub != ${defaultDockerHub} ]] && sed -i "s/blackcoinnl/${DockerHub}/" $0
|
||||
|
||||
# Git Account
|
||||
|
||||
HubLab=${HubLab:-${defaultHubLab}}
|
||||
[[ $HubLab != $defaultHubLab ]] && sed -i "s|github|${HubLab}|" $0
|
||||
|
||||
GitAccount=${GitAccount:-${defaultRepo}}
|
||||
[[ ${GitAccount} != ${defaultRepo} ]] && sed -i "s|CoinBlack|$GitAccount|" $0
|
||||
|
||||
# BRANCH
|
||||
|
||||
BRANCH=${BRANCH:-${defaultBranch}}
|
||||
[[ ${BRANCH} != ${defaultBranch} ]] && sed -i "s|v2.13.2.7|${BRANCH}|" $0
|
||||
|
||||
# TIMEZONE
|
||||
|
||||
TIMEZONE=${TIMEZONE:-${defaultTimezone}}
|
||||
[[ ${TIMEZONE} != ${defaultTimezone} ]] && sed -i "s|America/Los_Angeles|${TIMEZONE}|" $0
|
||||
|
||||
# build ubase
|
||||
ubase="ubase-${architecture}"
|
||||
Dockerfile="${BASE_DIR}/${architecture}/Dockerfile.${ubase}"
|
||||
docker build --network=host ${BASE_DIR}/${architecture} -t ${ubase} --build-arg BRANCH=${BRANCH} --build-arg TIMEZONE=${TZ} -f ${Dockerfile}
|
||||
|
||||
# build ubuntu
|
||||
ubuntu="ubuntu-${architecture}"
|
||||
Dockerfile="${BASE_DIR}/${architecture}/Dockerfile.${ubuntu}"
|
||||
docker build --network=host -t ${ubuntu}:${BRANCH} - < ${Dockerfile}
|
||||
[[ ${BRANCH} != master ]] || docker image tag ${ubuntu}:${BRANCH} ${DockerHub}/blackcoin-more-ubuntu-${architecture}:latest && \
|
||||
docker image tag ${ubuntu}:${BRANCH} ${DockerHub}/blackcoin-more-ubuntu-${architecture}:${BRANCH}
|
||||
|
||||
# build minimal
|
||||
minimal="minimal-${architecture}"
|
||||
rm -fr ${BASE_DIR}/${architecture}/parts
|
||||
docker run -itd --network=host --name ${ubase} ${ubase} bash
|
||||
docker cp ${ubase}:/${architecture}/parts ${BASE_DIR}/${architecture}/parts
|
||||
cd ${BASE_DIR}/${architecture}
|
||||
tar -C parts -c . | docker import - ${minimal}:${BRANCH}
|
||||
docker container rm -f ${ubase}
|
||||
[[ ${BRANCH} != master ]] || docker image tag ${minimal}:${BRANCH} ${DockerHub}/blackcoin-more-minimal-${architecture}:latest && \
|
||||
docker image tag ${minimal}:${BRANCH} ${DockerHub}/blackcoin-more-minimal-${architecture}:${BRANCH}
|
||||
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo -e ${usage}
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,74 @@
|
||||
FROM ubuntu AS ubase-base-x86_64-linux-gnu
|
||||
ARG BRANCH
|
||||
ENV BRANCH=$BRANCH
|
||||
ARG TIMEZONE
|
||||
ENV TIMEZONE=$TZ
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && apt-get install -yqq \
|
||||
git \
|
||||
make \
|
||||
file \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
libevent-dev \
|
||||
build-essential \
|
||||
autotools-dev \
|
||||
pkg-config \
|
||||
bsdmainutils \
|
||||
python3 \
|
||||
libevent-dev \
|
||||
libboost-all-dev \
|
||||
libminiupnpc-dev \
|
||||
libzmq3-dev \
|
||||
libssl-dev \
|
||||
gperf \
|
||||
wget \
|
||||
# blk commandline utility
|
||||
jq \
|
||||
bc \
|
||||
# cross compile arm
|
||||
g++-arm-linux-gnueabihf \
|
||||
binutils-arm-linux-gnueabihf \
|
||||
# cross compile aarch64
|
||||
g++-aarch64-linux-gnu \
|
||||
binutils-aarch64-linux-gnu \
|
||||
# cross compile macOS
|
||||
curl \
|
||||
librsvg2-bin \
|
||||
libtiff-tools \
|
||||
bsdmainutils \
|
||||
cmake \
|
||||
imagemagick \
|
||||
libcap-dev \
|
||||
libz-dev \
|
||||
libbz2-dev \
|
||||
python3-setuptools \
|
||||
libtinfo5
|
||||
|
||||
FROM ubase-base-x86_64-linux-gnu AS ubase-x86_64-linux-gnu
|
||||
|
||||
RUN git clone -b $BRANCH https://github.com/CoinBlack/blackcoin-more.git
|
||||
|
||||
COPY x86_64-linux-gnu ./x86_64-linux-gnu
|
||||
WORKDIR /blackcoin-more
|
||||
RUN (git clean -xf && \
|
||||
./autogen.sh && \
|
||||
./configure --prefix=/x86_64-linux-gnu --enable-glibc-back-compat --enable-reduce-exports --disable-tests --disable-bench --disable-gui-tests --enable-upnp-default LDFLAGS=-static-libstdc++ && \
|
||||
make -j4 && \
|
||||
make install && \
|
||||
cd src/ && \
|
||||
/usr/bin/strip blackmore*)
|
||||
|
||||
RUN cp /blackcoin-more/src/blackmored /usr/local/bin/ && \
|
||||
cp /blackcoin-more/src/blackmore-cli /usr/local/bin/ && \
|
||||
cp /blackcoin-more/contrib/blk /usr/local/bin/
|
||||
WORKDIR /x86_64-linux-gnu/parts
|
||||
RUN cp --parents /usr/local/bin/blk ./ && \
|
||||
cp --parents /usr/local/bin/blackmored ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmored | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp --parents /usr/local/bin/blackmore-cli ./ && \
|
||||
for i in `ldd /usr/local/bin/blackmore-cli | grep -v linux-vdso.so.1 | awk {' if ( $3 == "") print $1; else print $3 '}`; do cp --parents $i ./; done && \
|
||||
cp /usr/bin/bc --parents ./ && \
|
||||
cp /usr/bin/jq --parents ./
|
||||
WORKDIR /
|
||||
@@ -0,0 +1,23 @@
|
||||
FROM ubase-x86_64-linux-gnu AS ubuntu-x86_64-linux-gnu
|
||||
|
||||
# Collect dependencies
|
||||
|
||||
FROM ubuntu
|
||||
ENV TZ=America/Los_Angeles
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
RUN apt-get update && \
|
||||
apt-get -yqq upgrade && \
|
||||
apt-get -yqq install \
|
||||
libboost-all-dev \
|
||||
libzmq3-dev \
|
||||
libminiupnpc-dev
|
||||
|
||||
# Copy the binaries to our new container
|
||||
COPY --from=ubase-x86_64-linux-gnu /blackcoin-more/src/blackmored /usr/local/bin
|
||||
COPY --from=ubase-x86_64-linux-gnu /blackcoin-more/src/blackmore-cli /usr/local/bin
|
||||
COPY --from=ubase-x86_64-linux-gnu /usr/bin/bc /usr/bin
|
||||
COPY --from=ubase-x86_64-linux-gnu /usr/bin/jq /usr/bin
|
||||
|
||||
# Expose the port for the RPC interface
|
||||
|
||||
EXPOSE 15714/tcp
|
||||
@@ -1,22 +0,0 @@
|
||||
[Unit]
|
||||
Description=Bitcoin's distributed currency daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=bitcoin
|
||||
Group=bitcoin
|
||||
|
||||
Type=forking
|
||||
PIDFile=/var/lib/bitcoind/bitcoind.pid
|
||||
ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \
|
||||
-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet
|
||||
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStartSec=2s
|
||||
StartLimitInterval=120s
|
||||
StartLimitBurst=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
31
contrib/init/blackmored.service
Normal file
31
contrib/init/blackmored.service
Normal file
@@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description=Blackmore daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=export MALLOC_ARENA_MAX=1 && /usr/local/bin/blackmored -daemon -conf=/var/lib/.blackmore/blackmore.conf -datadir=/var/lib/.blackmore
|
||||
>>>>>>> 5fbf64be585767e86ad48dbd1dfb02141a8f23ab
|
||||
ExecStop=/usr/local/bin/blackmored stop
|
||||
User=blackmore
|
||||
Group=blackmore
|
||||
Restart=on-failure
|
||||
|
||||
# Because it's a daemon process
|
||||
Type=forking
|
||||
|
||||
PIDFile=/var/lib/.bitmored/blackmored.pid
|
||||
|
||||
ProtectHome=true
|
||||
ProtectSystem=full
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
MemoryDenyWriteExecute=true
|
||||
NoNewPrivileges=true
|
||||
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStartSec=2s
|
||||
StartLimitInterval=120s
|
||||
StartLimitBurst=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user