forked from ceph/ceph-container
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__DOCKERFILE_CLEAN_COMMON__
More file actions
29 lines (29 loc) · 1.56 KB
/
Copy path__DOCKERFILE_CLEAN_COMMON__
File metadata and controls
29 lines (29 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
rm -rf \
/etc/{selinux,systemd,udev} \
/lib/{lsb,udev} \
/tmp/* \
/usr/lib{,64}/{locale,systemd,udev,dracut} \
/usr/share/{doc,info,locale,man} \
/usr/share/{bash-completion,pkgconfig/bash-completion.pc} \
/var/log/* \
/var/tmp/* && \
find / -xdev -name "*.pyc" -o -name "*.pyo" -exec rm -f {} \; && \
# ceph-dencoder is only used for debugging, compressing it saves 10MB
# If needed it will be decompressed
# TODO: Is ceph-dencoder safe to remove as rook was trying to do?
# rm -f /usr/bin/ceph-dencoder && \
if [ -f /usr/bin/ceph-dencoder ]; then gzip -9 /usr/bin/ceph-dencoder; fi && \
# TODO: What other ceph stuff needs removed/stripped/zipped here?
# TODO: There was some overlap between this and the ceph clean? Where does it belong?
# If it's idempotent, it can *always* live here, even if it doesn't always apply
# TODO: Should we even strip ceph libs at all?
bash -c ' \
function ifstrip () { if compgen -g "$1"; then strip -s "$1"; fi } && \
ifstrip /usr/lib{,64}/ceph/erasure-code/* && \
ifstrip /usr/lib{,64}/rados-classes/* && \
ifstrip /usr/lib{,64}/python*/{dist,site}-packages/{rados,rbd,rgw}.*.so && \
ifstrip /usr/bin/{crushtool,monmaptool,osdmaptool}' && \
# Photoshop files inside a container ?
rm -f /usr/lib/ceph/mgr/dashboard/static/AdminLTE-*/plugins/datatables/extensions/TableTools/images/psd/* && \
# Some logfiles are not empty, there is no need to keep them
find /var/log/ -type f -exec truncate -s 0 {} \;