iglunix-autobuild/docker_init_clean

42 lines
1.1 KiB
Bash
Executable File

#! /bin/sh
#Stop & remove all the old
docker service rm my_compile_farm || true
docker image rm local:iglunix_abyss || true
rm image_name || true
rm iglunix_abyss.tar || true
echo "Cleaned and ready for the first/next attempt!"
#Create new modified container
docker build . --iidfile image_name --file Dockerfile_update
image_name="`cat image_name`" #This is an intermidiary image
echo "docker run starting, this may take a while"
docker run --name updated_abyss ${image_name}
echo "docker run finished"
if false
then
docker run -d -p 5000:5000 --name my_registry registry:2
echo "Created my_registry"
docker commit updated_abyss localhost:5000/iglunix_abyss
echo "Created localhost:5000:iglunix_abyss"
docker push localhost:5000/iglunix_abyss
echo "pushed localhost:5000:iglunix_abyss"
else
docker commit updated_abyss local:iglunix_abyss
docker save -o ./iglunix_abyss.tar local:iglunix_abyss
echo "Move this tar to all nodes, then \"docker load -i iglunix_abyss.tar\""
fi
#docker image rm ${image_name}
#echo "Removed intermidiary ${image_name}"