$ nomad node-drain -self -enable
!#/bin/bash
export NOMAD_DATA_ROOT=/opt/nomad
for ALLOC in `ls -d $NOMAD_DATA_ROOT/alloc/*`; do
for JOB in `ls ${ALLOC} | grep -v alloc`; do
umount ${ALLOC}/${JOB}/secrets;
umount ${ALLOC}/${JOB}/dev;
umount ${ALLOC}/${JOB}/proc;
umount ${ALLOC}/${JOB}/alloc;
done;
done
rm -Rf $NOMAD_DATA_ROOT
docker rmi $(docker images -a -q)
docker rm $(docker ps -a -f status=exited -q)
curl -XPUT http://127.0.0.1:4646/v1/system/gc