Commit 9402b4ab by Ned Batchelder

A script for making box files smaller

(cherry picked from commit be7f7904)
parent 36bbf4c9
......@@ -32,6 +32,7 @@
with_items:
- { src: 'update.j2', dest: 'update' }
- { 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