Blame docker-builder/build-tgz.sh

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