diff --git a/Dockerfile b/Dockerfile
index 8cf94998b40ee955fef2f6ec2b890fe06275e4ff..e229aa7c42091e63fa67aa016556db96b86140c4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,6 +9,7 @@ RUN apk --no-cache add python3 && \
     python3 -m venv /opt/ansible && \
     pip3 install --ignore-installed --no-cache-dir --upgrade --disable-pip-version-check pip setuptools wheel && \
     pip3 install --ignore-installed --no-cache-dir ansible ${ANSIBLE_PACKAGES} && \
+    find /opt/ansible \( -type d -a -name test -o -name tests \) -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) -exec rm -rvf '{}' \+ && \
     #apk del build-dependencies && \
     rm -rf /var/cache/apk/*