tpotce/getimages.sh

45 lines
1.3 KiB
Bash
Raw Normal View History

2015-12-08 14:47:39 +00:00
#!/bin/bash
########################################################
# T-Pot #
# Export docker images maker #
# #
2016-03-09 13:05:06 +00:00
# v16.03.1 by mo, DTAG, 2016-03-09 #
2015-12-08 14:47:39 +00:00
########################################################
# This feature is experimental and requires at least docker 1.7!
2016-03-09 13:05:06 +00:00
# Using any docker version < 1.7 may result in a unusable T-Pot installation
2015-12-08 14:47:39 +00:00
# This script will download the docker images and export them to the folder "images".
# When building the .iso image the preloaded docker images will be exported to the .iso which
# may be useful if you need to install more than one machine.
# Got root?
myWHOAMI=$(whoami)
if [ "$myWHOAMI" != "root" ]
then
echo "Please run as root ..."
exit
fi
if [ -z $1 ]
then
echo "Please view the script for more details!"
exit
fi
if [ $1 == "now" ]
then
2016-02-22 16:47:24 +00:00
for name in $(cat installer/data/imgcfg/all_images.conf)
2015-12-08 14:47:39 +00:00
do
2016-05-30 14:51:32 +00:00
docker pull dtagdevsec/$name:latest1610
2015-12-08 14:47:39 +00:00
done
mkdir images
chmod 777 images
for name in $(cat installer/data/full_images.conf)
do
echo "Now exporting dtagdevsec/$name:latest1603"
2016-05-30 14:51:32 +00:00
docker save -o images/$name:latest1610.img dtagdevsec/$name:latest1610
2015-12-08 14:47:39 +00:00
done
chmod 777 images/*.img
fi