clean.sh
oldImageId=`docker images| awk 'NR==2{print $3}'`
echo "old imageId:"$oldImageId
oldContainerId=`docker ps| awk 'NR==2{print $1}'`
echo "old containerId:"$oldContainerId
if [ -n "$oldContainerId" ]; then
docker stop "$oldContainerId"
echo "stop old containerId: $oldContainerId"
docker rm -f "$oldContainerId"
echo "rm old containerId: $oldContainerId"
fi
echo "stop old containerId:"$oldContainerId
if [ -n "$oldImageId" ]; then
docker rmi "$oldImageId"
echo "rm old imageId: $oldImageId"
fi
run.sh
imageId=`docker images| awk 'NR==2{print $3}'`
echo "new imageId:"$imageId
if [ -n "$imageId" ]; then
docker run -d -p 8080:8080 -e JAVA_OPTS="-Xms4g -Xmx6g" -v /ppt2video:/ppt2video $imageId
fi
评论区