Funktioniert - im Docker

This commit is contained in:
2019-04-04 19:49:32 +02:00
parent 0fe884c90a
commit 0af306aafb
4 changed files with 68 additions and 2 deletions

31
build_and_copy.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Build Docker-Container
#
# Call: buildit.sh name [target]
#
# The Dockerfile must be named like Dockerfile_name
#
# 2018-09-20 rxf
# - before sending docker image to remote, tag actual remote image
#
# 2018-09-14 rxf
# - first Version
#
# set -x
if [ $# -lt 1 ]
then
echo "Usage buildit_and_copy.sh name [target]"
echo " name: Name of container"
echo " target: Where to copy the container to (optional)"
exit
fi
docker build -f Dockerfile_$1 -t $1 .
if [ $2 != "" ]
then
dat=`date +%Y%m%d%H%M`
ssh $2 "docker tag $1 $1:V_$dat"
docker save $1 | bzip2 | pv | ssh $2 'bunzip2 | docker load'
fi