reorganize folders

This commit is contained in:
danielclough
2020-12-27 17:20:23 +01:00
parent 4bb08626b7
commit ad13bb75d8
7 changed files with 190 additions and 34 deletions

View File

@@ -0,0 +1,3 @@
[Trash Info]
Path=contrib/docker/Dockerfile.ubase-base
DeletionDate=2020-12-27T08:13:05

7
contrib/docker/.gitignore vendored Normal file
View 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

View File

@@ -1,4 +1,56 @@
FROM ubase-base AS ubase-aarch64-linux-gnu
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

View File

@@ -1,4 +1,54 @@
FROM ubase-base AS ubase-arm-linux-gnueabihf
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

View File

@@ -61,11 +61,13 @@ if [[ $1 == -i ]]; then
echo "Git Account: ${HubLab}.com/${GitAccount} ${BRANCH}"
echo "Timezone: ${TIMEZONE}"
else
echo "Option Mode!"
echo "Architecture: $2"
echo "DockerHub Account: $3"
echo "Git Account: https://${4}.com/${5} ${6}"
echo "Timezone: ${7}"
echo -e "
Option Mode! \n
Architecture: $2
DockerHub Account: $3
Git Account: https://${4}.com/${5} ${6}
Timezone: ${7}
"
fi
# Architecture
@@ -82,24 +84,21 @@ else
# Download Dependencies
if [[ -f ${BASE_DIR}/depends-${architecture}.tar.xz ]]; then
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! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|| exit 1
[[ "${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! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|| exit 1
[[ "${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! You will need sudo to untar the dependencies." && sudo tar xJf ${BASE_DIR}/depends-${architecture}.tar.xz -C ${BASE_DIR}/\
|| exit 1
[[ "${checkSUM}" == "OK" ]] && echo "The sha256sum is OK!" || exit 1
;;
esac
else
@@ -140,49 +139,44 @@ else
# Git Account
HubLab=${HubLab:-${defaultHubLab}}
[[ $HubLab != $defaultHubLab ]] && sed -i "s|github|${HubLab}|" ${BASE_DIR}/Dockerfile.ubase && sed -i "s|github|${HubLab}|" $0
[[ $HubLab != $defaultHubLab ]] && sed -i "s|github|${HubLab}|" $0
GitAccount=${GitAccount:-${defaultRepo}}
[[ ${GitAccount} != ${defaultRepo} ]] && sed -i "s|CoinBlack|$GitAccount|" ${BASE_DIR}/Dockerfile.ubase && sed -i "s|CoinBlack|$GitAccount|" $0
[[ ${GitAccount} != ${defaultRepo} ]] && sed -i "s|CoinBlack|$GitAccount|" $0
# BRANCH
BRANCH=${BRANCH:-${defaultBranch}}
[[ ${BRANCH} != ${defaultBranch} ]] && sed -i "s|ENV BRANCH=v2.13.2.7|ENV BRANCH=${BRANCH}|" ${BASE_DIR}/Dockerfile.ubase && sed -i "s|v2.13.2.7|${BRANCH}|" $0
[[ ${BRANCH} != ${defaultBranch} ]] && sed -i "s|v2.13.2.7|${BRANCH}|" $0
# TIMEZONE
TIMEZONE=${TIMEZONE:-${defaultTimezone}}
[[ ${TIMEZONE} != ${defaultTimezone} ]] && sed -i "s|America/Los_Angeles|${TIMEZONE}|" ${BASE_DIR}/Dockerfile.ubase && \
sed -i "s|America/Los_Angeles|${TIMEZONE}|" ${BASE_DIR}/Dockerfile.ubuntu && sed -i "s|America/Los_Angeles|${TIMEZONE}|" $0
# build ubase-base
Dockerfile="${BASE_DIR}/Dockerfile.ubase-base"
docker build -t ubase-base --build-arg BRANCH=${BRANCH} --network=host - < ${Dockerfile}
[[ ${TIMEZONE} != ${defaultTimezone} ]] && sed -i "s|America/Los_Angeles|${TIMEZONE}|" $0
# build ubase
ubase="ubase-${architecture}"
Dockerfile="${BASE_DIR}/${architecture}/Dockerfile.${ubase}"
docker buildx ${BASE_DIR}/${architecture} --platform ${platform} -t ${ubase} --network=host -f ${Dockerfile}
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 buildx -t ${ubuntu} - --platform ${platform} --network=host < ${Dockerfile}
[[ ${BRANCH} != master ]] && docker image tag ${ubuntu} ${DockerHub}/blackcoin-more-ubuntu-${architecture}:${BRANCH} || \
(docker image tag ${ubuntu} ${DockerHub}/blackcoin-more-ubuntu-${architecture}:latest; docker image tag ${ubuntu} ${DockerHub}/blackcoin-more-ubuntu-${architecture}:${BRANCH})
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 ${ubase}:${architecture}/parts
rm -fr ${BASE_DIR}/${architecture}/parts
docker run -itd --network=host --name ${ubase} ${ubase} bash
docker cp ${ubase}:${architecture}/parts ${BASE_DIR}/${architecture}/parts
docker cp ${ubase}:/${architecture}/parts ${BASE_DIR}/${architecture}/parts
cd ${BASE_DIR}/${architecture}
tar -C parts -c . | docker import --platform ${platform} - ${minimal}
tar -C parts -c . | docker import - ${minimal}:${BRANCH}
docker container rm -f ${ubase}
[[ ${BRANCH} != master ]] && docker image tag ${minimal} ${DockerHub}/blackcoin-more-minimal-${architecture}:${BRANCH} || \
(docker image tag ${minimal} ${DockerHub}/blackcoin-more-minimal-${architecture}:latest; docker image tag ${minimal} ${DockerHub}/blackcoin-more-minimal-${architecture}:${BRANCH})
[[ ${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
;;
*)

View File

@@ -1,4 +1,54 @@
FROM ubase-base AS ubase-x86_64-linux-gnu
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