vagrant-lxc-ng/boxes/common/package.sh
2014-03-09 21:21:38 -03:00

22 lines
437 B
Bash
Executable file

#!/bin/bash
set -e
source common/ui.sh
info "Packaging '${CONTAINER}' to '${PACKAGE}'..."
debug 'Stopping container'
lxc-stop -n ${CONTAINER} &>/dev/null || true
debug "Removing previous rootfs tarbal"
rm -f ${WORKING_DIR}/rootfs.tar.gz
log "Compressing container's rootfs"
cd $(dirname ${ROOTFS})
tar --numeric-owner -czf ${WORKING_DIR}/rootfs.tar.gz ./rootfs/*
# Prepare package contents
cd ${WORKING_DIR}
warn 'TODO: Package!'