Skip to content

Commit

Permalink
build: create docker script for 26.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackcoinDev committed Sep 10, 2024
1 parent f219346 commit 0c3f79e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions contrib/docker/gh-build-26.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

BASE_DIR=$(dirname $(realpath $0 ))
moreBuilder=${BASE_DIR}/moreBuilder
rm -fr ${moreBuilder}/*

export SYSTYPE=x86_64
export DockerHub=blackcoinnl
export HUBLAB=github
export GITNAME=CoinBlack
export BRANCH=${GIT_CURRENT_BRANCH}
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"
echo "DockerHub Account: ${DockerHub}"
echo "Git Account: ${GITNAME}"
echo ${BRANCH}
echo ${SYSTYPE}
echo ${TZ}

# tag names
base="${DockerHub}/blackcoin-more-26.2.0-base-${SYSTYPE}:${BRANCH}"
minimal="${DockerHub}/blackcoin-more-26.2.0-minimal-${SYSTYPE}:${BRANCH}"
ubuntu="${DockerHub}/blackcoin-more-26.2.0-ubuntu-${SYSTYPE}:${BRANCH}"

# build
# ubase (base using ubuntu)
# ubuntu (package with full ubuntu distro)
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 0c3f79e

Please sign in to comment.