destroy the container before creating to force re-bootstrap
This commit is contained in:
parent
f96e59a033
commit
18ebd8695e
1 changed files with 5 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Configurable params
|
# Configurable params
|
||||||
BRIDGE=${BRIDGE:-br0}
|
BRIDGE=${BRIDGE:-br0}
|
||||||
CONTAINER=${CONTAINER:-STACK}
|
CONTAINER=${CONTAINER:-STACK}
|
||||||
|
@ -49,9 +50,13 @@ if [ -d /cgroup/$CONTAINER ]; then
|
||||||
cgdelete -r cpu,net_cls:$CONTAINER
|
cgdelete -r cpu,net_cls:$CONTAINER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Warm the base image on first install
|
# Warm the base image on first install
|
||||||
CACHEDIR=/var/cache/lxc/natty/rootfs-amd64
|
CACHEDIR=/var/cache/lxc/natty/rootfs-amd64
|
||||||
if [ ! -d $CACHEDIR ]; then
|
if [ ! -d $CACHEDIR ]; then
|
||||||
|
# by deleting the container, we force lxc-create to re-bootstrap (lxc is
|
||||||
|
# lazy and doesn't do anything if a container already exists)
|
||||||
|
lxc-destroy -n $CONTAINER
|
||||||
# trigger the initial debootstrap
|
# trigger the initial debootstrap
|
||||||
lxc-create -n $CONTAINER -t natty -f $LXC_CONF
|
lxc-create -n $CONTAINER -t natty -f $LXC_CONF
|
||||||
chroot $CACHEDIR apt-get update
|
chroot $CACHEDIR apt-get update
|
||||||
|
|
Loading…
Reference in a new issue