Reduce images size

This commit is contained in:
Oleksii Shevchuk 2017-03-14 13:42:38 +02:00
parent 30ad7c1a2a
commit 6350ad9ab4
5 changed files with 21 additions and 7 deletions

View File

@ -275,6 +275,7 @@ CFLAGS="-O2 -pipe -DCLOCK_MONOTONIC=1 -UHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC -U
python -O -m pip install pyuv --no-binary :all:
cd /usr/lib/python2.7
python -O -m compileall -q
python -OO -m compileall -q
find -name "*.so" | while read f; do strip \$f; done
@ -496,6 +497,7 @@ cd /usr/src/automake-1.15
python -O -m pip install pyuv --no-binary :all:
cd /usr/lib/python2.7
python -O -m compileall -q
python -OO -m compileall -q
find -name "*.so" | while read f; do strip \$f; done
@ -526,6 +528,8 @@ cd buildenv/lin64/usr/lib/python2.7
zip -y \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" -x "*.pyo" \
-x "*test/*" -x "*tests/*" -x "*examples/*" \
-x "*.egg-info/*" -x "*.dist-info/*" \
-x "idlelib/*" -x "lib-tk/*" -x "tk*" -x "tcl*" \
-r9 ${TEMPLATES}/linux-amd64.zip .
cd -
@ -533,6 +537,8 @@ cd buildenv/lin32/usr/lib/python2.7
zip -y \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" -x "*.pyo" \
-x "*test/*" -x "*tests/*" -x "*examples/*" \
-x "*.egg-info/*" -x "*.dist-info/*" \
-x "idlelib/*" -x "lib-tk/*" -x "tk*" -x "tcl*" -x "*.la" \
-r9 ${TEMPLATES}/linux-x86.zip .
cd -

View File

@ -16,7 +16,7 @@ PYTHONVC="https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-
# PYWIN32="http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20220/pywin32-220.win32-py2.7.exe"
# PYWIN64="http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20220/pywin32-220.win-amd64-py2.7.exe"
PACKAGES="rpyc pyaml rsa pefile image rsa netaddr win_inet_pton netaddr tinyec pycrypto cryptography pypiwin32"
PACKAGES="rpyc pyaml rsa pefile rsa netaddr win_inet_pton netaddr tinyec pycrypto cryptography pypiwin32"
PACKAGES="$PACKAGES mss pyaudio scapy pyOpenSSL colorama pyuv"
BUILDENV=${1:-`pwd`/buildenv}
@ -235,8 +235,10 @@ rm -f ${TEMPLATES}/windows-x86.zip
for dir in Lib DLLs; do
cd $dir
zip -q -y \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" \
-x "*test/*" -x "*tests/*" -x "*examples/*" \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" -x "*.pyo" -x "*.chm" \
-x "*test/*" -x "*tests/*" -x "*examples/*" -x "pythonwin/*" \
-x "idlelib/*" -x "lib-tk/*" -x "tk*" -x "tcl*" \
-x "*.egg-info/*" -x "*.dist-info/*" -x "*.exe" \
-r9 ${TEMPLATES}/windows-x86.zip .
cd -
done
@ -247,8 +249,10 @@ rm -f ${TEMPLATES}/windows-amd64.zip
for dir in Lib DLLs; do
cd $dir
zip -q -y \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" \
-x "*test/*" -x "*tests/*" -x "*examples/*" \
-x "*.a" -x "*.o" -x "*.whl" -x "*.txt" -x "*.py" -x "*.pyo" -x "*.chm" \
-x "*test/*" -x "*tests/*" -x "*examples/*" -x "pythonwin/*" \
-x "idlelib/*" -x "lib-tk/*" -x "tk*" -x "tcl*" \
-x "*.egg-info/*" -x "*.dist-info/*" -x "*.exe" \
-r9 ${TEMPLATES}/windows-amd64.zip .
cd -
done

View File

@ -11,3 +11,5 @@ external/scapy
**/__pycache__*
**/test?
packages/src
**/*.pyc
**/*.pyo

View File

@ -28,7 +28,6 @@ COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt --no-binary :all:
COPY . /opt/pupy
RUN cd /opt/pupy && python -O -m compileall -qf && python -OO -m compileall -qf
ADD https://github.com/gentilkiwi/mimikatz/releases/download/2.1.0-20170305/mimikatz_trunk.zip \
/opt/mimikatz/mimikatz.zip

View File

@ -46,7 +46,10 @@ echo "$1" >/home/pupy/.project
cd /opt/pupy
python -m compileall -q >/dev/null
find -type f -exec md5sum {} >/projects/integrity.txt
python -O -m compileall -qf
python -OO -m compileall -qf
echo 'Copy your authorized_keys here!' >/projects/keys/README