Skip to content

Commit

Permalink
build: improve docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackcoinDev committed Sep 7, 2024
1 parent bec9176 commit 4faf0c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile.minbase
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN git clone -b $BRANCH https://$HUBLAB.com/$GITNAME/blackcoin-more.git && \
make install && \
cd ../.. && \
cd blackcoin-more/ && ./autogen.sh && \
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --disable-tests --disable-bench --enable-reduce-exports && \
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --enable-upnp-default --disable-man --enable-sse2 --disable-tests --disable-bench --enable-reduce-exports && \
make -j4 && \
cd src/ && \
strip blackmore*) && \
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/Dockerfile.ubase
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN git clone -b $BRANCH https://$HUBLAB.com/$GITNAME/blackcoin-more.git && \
make install && \
cd ../.. && \
cd blackcoin-more/ && ./autogen.sh && \
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --disable-tests --disable-bench --enable-reduce-exports && \
./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --enable-upnp-default --disable-man --enable-sse2 --disable-tests --disable-bench --enable-reduce-exports && \
make -j4 && \
cd src/ && \
strip blackmore*) && \
Expand Down
21 changes: 17 additions & 4 deletions contrib/docker/gh-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export DockerHub=blackcoinnl
export HUBLAB=github
export GITNAME=CoinBlack
export BRANCH=${GIT_CURRENT_BRANCH}
sed -i "master|${BRANCH}|" ${BASE_DIR}/Dockerfile.ubase
sed -i "master|${BRANCH}|" ${BASE_DIR}/Dockerfile.ubuntu
sed -i "s/master/${BRANCH}/" ${BASE_DIR}/Dockerfile.ubase
sed -i "s/master/${BRANCH}/" ${BASE_DIR}/Dockerfile.ubuntu
export TZ=Etc/UTC

echo "${GITHUB_ENV} = GITHUB_ENV"
Expand All @@ -28,12 +28,25 @@ ubuntu="${DockerHub}/blackcoin-more-ubuntu-${SYSTYPE}:${BRANCH}"
# build
# ubase (base using ubuntu)
# ubuntu (package with full ubuntu distro)
docker build -t ${base} - --network=host < ${BASE_DIR}/Dockerfile.ubase
docker build -t ${ubuntu} - --network=host < ${BASE_DIR}/Dockerfile.ubuntu
docker build -t ${base} --network=host -f ${BASE_DIR}/Dockerfile.ubase ${BASE_DIR}
if [ $? -ne 0 ]; then
echo "Error building base image" && exit 1
fi
docker build -t ${ubuntu} --network=host -f ${BASE_DIR}/Dockerfile.ubuntu ${BASE_DIR}
if [ $? -ne 0 ]; then
echo "Error building ubuntu image" && exit 1
fi
docker image push ${ubuntu}
if [ $? -ne 0 ]; then
echo "Error pushing image" && exit 1
fi


# minimal (only package binaries and scripts)
docker run -itd --network=host --name base ${base} bash
docker cp base:/parts ${moreBuilder}
cd ${moreBuilder}
tar -c . | docker import - ${minimal} && docker image push ${minimal}
if [ $? -ne 0 ]; then
echo "Error creating and pushing minimal image" && exit 1
fi

0 comments on commit 4faf0c1

Please sign in to comment.