Commit be7f7904 by Ned Batchelder

A script for making box files smaller

parent 57cdd192
......@@ -53,6 +53,7 @@
mode: "0755"
with_items:
- { src: 'show-repo-heads.j2', dest: 'show-repo-heads' }
- { src: 'pre-box.j2', dest: 'pre-box' }
tags:
- install
- install:configuration
......
#!/usr/bin/env bash
#
# Remove needless noise from file systems before packaging a Vagrant box file.
# This can reduce the size of the box file by 25%.
# Run this with sudo in the guest OS just before "vagrant package" in the host.
set -x
# Discard packages we don't need.
apt-get clean -y
apt-get autoclean -y
# Clean out pip caches.
find / -type d -path '*/.cache/pip' -print -exec rm -rf '{}/*' \;
# Remove all the .pyc files.
find /edx/app -name '*.pyc' -delete
# Last thing: fill the disk with zeros so they'll compress well.
dd if=/dev/zero of=/empty bs=1M
rm -f /empty
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment