docker build command can now take Dockerfile as argument

This commit is contained in:
jash
2018-10-08 23:47:13 +02:00
committed by kexkey
parent b285c2ded6
commit b67db12ef0
2 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
build_docker_image() {
local dockerfile="Dockerfile"
if [[ ""$3 != "" ]]; then
dockerfile=$3
fi
trace "building docker image: $2:latest"
docker build -q $1 -t $2:latest > /dev/null
docker build -q $1 -f $1/$dockerfile -t $2:latest > /dev/null
}

View File

@@ -38,7 +38,12 @@ install_docker() {
if [[ $FEATURE_LIGHTNING == true ]]; then
if [[ $LIGHTNING_IMPLEMENTATION == "c-lightning" ]]; then
build_docker_image ../SatoshiPortal/dockers/$archpath/LN/c-lightning cyphernode/clightning
local dockerfile="Dockerfile"
if [[ $archpath == "rpi" ]]; then
dockerfile="Dockerfile-alpine"
fi
build_docker_image ../SatoshiPortal/dockers/$archpath/LN/c-lightning cyphernode/clightning $dockerfile
if [ ! -d $LIGHTNING_DATAPATH ]; then
trace "Creating $LIGHTNING_DATAPATH"
mkdir -p $LIGHTNING_DATAPATH