vagrant-lxc-ng/boxes/common/package.sh

22 lines
437 B
Bash
Raw Normal View History

#!/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!'