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

fix python dependencies build error and shrink docker image size #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kmahyyg
Copy link

@kmahyyg kmahyyg commented Oct 18, 2020

The philosophy of Docker is simple, small and easy.

Reason why I did this:

  • Jessie is an old debian version, we should upgrade to latest.
  • apt relies on python, python on jessie is 3.4, which means you have both 3.4 and 3.6 in your docker image, it's dirty.
  • python in docker-compose.yml should switch to python3, since the default python of the most old distro is python2.
  • According to the philosophy of docker, I upgraded the debian to latest and only use the latest (3.8 here) python in a single image, which avoided two python works in a image.
  • Docker is running using overlay storage structure, so you should combine the shell command which runs for the same purpose in a single RUN row to shrink the image size.
  • Due to the upgrade of Python and distro, I just fixed build error when running pip3 install -r, so I changed the requirements.txt and built myself.

The image built on my machine is successfully finished and runs perfectly. Works fine for me.

@kmahyyg
Copy link
Author

kmahyyg commented Oct 18, 2020

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mqtt-pwn_cli        latest              a8120b7894cc        11 minutes ago      273MB

This also fixed Issue #7

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

Successfully merging this pull request may close these issues.

1 participant