Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce image size by removing *.pyc + wheels from the image #8

Open
pmav99 opened this issue Jan 4, 2019 · 0 comments
Open

Reduce image size by removing *.pyc + wheels from the image #8

pmav99 opened this issue Jan 4, 2019 · 0 comments

Comments

@pmav99
Copy link

pmav99 commented Jan 4, 2019

You could reduce the image size by removing *.pyc + wheels from the image. E.g. something like this:

# Install ansible + dependencies.
RUN apt-get update \
 && apt-get install -y --no-install-recommends \
       apt-utils \
       python-setuptools \
       python-pip \
       software-properties-common \
       rsyslog systemd systemd-cron sudo \
 # install ansible via pip
 && pip install $pip_packages \
 # clean up
 && apt autoremove -y \
 && apt clean \
 && rm -rf /var/lib/apt/lists/* \
           /var/tmp/* \
           /usr/share/doc \
           /usr/share/man \
 # remove python files
 && rm -rf /root/.cache/pip/ \
 && find / -name '*.pyc' -delete \
 && find / -name '*__pycache__*' -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant