Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #506 from devimc/2020-12-10/improveDebian
Browse files Browse the repository at this point in the history
rootfs: reduce size of debian image
  • Loading branch information
Julio Montes authored Jan 12, 2021
2 parents fbed151 + 18455a0 commit ae8ae1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rootfs-builder/ubuntu/rootfs_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,13 @@ build_rootfs() {
${ROOTFS_DIR}

chroot $ROOTFS_DIR ln -s /lib/systemd/systemd /usr/lib/systemd/systemd
}

# Reduce image size and memory footprint
# removing not needed files and directories.
chroot $ROOTFS_DIR apt-get purge -y locales
find ${ROOTFS_DIR}/usr/share/doc -depth -type f ! -iname "*copyright*" | xargs rm -f || true
find ${ROOTFS_DIR}/usr/share/doc -empty | xargs rmdir || true
find ${ROOTFS_DIR}/usr/share/doc -type f -exec gzip -9 {} \;
rm -rf ${ROOTFS_DIR}/usr/share/{groff,info,lintian,linda,man}
rm -rf ${ROOTFS_DIR}/usr/share/{bash-completion,locale,menu,misc,pixmaps,terminfo,zoneinfo,zsh}
}

0 comments on commit ae8ae1c

Please sign in to comment.