Blame docker/debian-7-32bit/build-tgz.sh

10e43d
#!/bin/bash -x
10e43d
10e43d
set -e
10e43d
10e43d
arch=i386
10e43d
suite=wheezy
10e43d
chroot_dir="/var/chroot/$suite"
10e43d
apt_mirror="ftp://ftp.debian.org/debian/"
10e43d
8fa589
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
8fa589
BASE_DIR=`dirname "$SCRIPT_DIR"`
8fa589
BASE_DIR=`dirname "$BASE_DIR"`
8fa589
CONFIG_FILE="$BASE_DIR/config.sh"
8fa589
if [ -f $CONFIG_FILE ]; then
8fa589
	source $CONFIG_FILE
8fa589
fi
8fa589
10e43d
export DEBIAN_FRONTEND=noninteractive
10e43d
debootstrap --arch $arch $suite $chroot_dir $apt_mirror
10e43d
10e43d
cat <<eof> $chroot_dir/etc/apt/sources.list</eof>
10e43d
deb $apt_mirror $suite main
10e43d
deb $apt_mirror $suite-updates main
10e43d
deb http://security.debian.org/ $suite/updates main
10e43d
EOF
10e43d
10e43d
chroot $chroot_dir apt-get update
10e43d
chroot $chroot_dir apt-get upgrade -y
10e43d
chroot $chroot_dir apt-get autoclean
10e43d
chroot $chroot_dir apt-get clean
10e43d
chroot $chroot_dir apt-get autoremove
10e43d
8fa589
tar cfz "$SCRIPT_DIR/debian-$suite-$arch.tar.gz" -C $chroot_dir .
10e43d
rm -rf $chroot_dir