2016-07-25 00:28:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# pluie/docker-images - a-Sansara (https://github.com/a-sansara)
|
|
|
|
|
|
|
|
Ctitle="\033[1;38;5;15;1;48;5;30m"
|
|
|
|
Citem="\033[1;38;5;36m"
|
|
|
|
Coff="\033[m"
|
2016-07-25 01:04:16 +00:00
|
|
|
DOCKDIR=$(dirname "$(readlink -f ${BASH_SOURCE[0]})")
|
|
|
|
DOCKBUILD=$(basename $DOCKDIR)
|
|
|
|
DOCKREPO=$(basename $(dirname $(readlink -f ${DOCKBUILD})))
|
2016-07-25 00:28:26 +00:00
|
|
|
DOCKTAG=${1:-"latest"}
|
2016-07-25 01:04:16 +00:00
|
|
|
TMPPWD=$(pwd)
|
2016-07-25 00:28:26 +00:00
|
|
|
indent=" "
|
2016-07-25 01:04:16 +00:00
|
|
|
cd $DOCKDIR
|
2016-07-25 00:28:26 +00:00
|
|
|
echo -e "\n ${Ctitle} Preparing files : ${Coff}${Citem}\n"
|
|
|
|
|
2016-07-25 01:04:16 +00:00
|
|
|
tar -cvf files.tar *.sh pre-init.d/ install.d/ | sed "s/^/${indent}* /"
|
2016-07-25 00:28:26 +00:00
|
|
|
|
|
|
|
echo -e "\n ${Ctitle} Proceed Dockerfile build : ${Coff}\n
|
|
|
|
"
|
2016-07-25 01:04:16 +00:00
|
|
|
docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/"
|
|
|
|
cd $TMPPWD
|