构造大镜像
usage()
echo "usage: batch-gen-image.sh[IMAGE REPO]"
echo "[IMAGEREPO]the image repo, must be required"
if [[ $# -lt 1]];
then
usage
exit
fi
REPO=$1
mkdir -p gen- giant-image
cd gen- giant-image
rm -fr ./*
for i in (1..10);
do
cat <<EOF>>
giantimage.Dockerfile
FROM myharbor.com.cn/library/tomcat:8.5.34
WORKDIR /
RUN dd if=/dev/urandom of=/random_file bs=1M count=$(($RANDOM%900+100 +800))
CMD ["sleep","36000000"]
EOF
docker build -t ${REPO}/test- giant-image:v${i} -f giantimage.Dockerfile .
for i in (1..10);
do
kubectl create deploy test-app-${i}-n default --image=${REPO}/test- giant-image:v${i}
done