NASA-PDS / registry-sweepers

Scripts that run regularly on the registry database, to clean and consolidate information
Apache License 2.0
0 stars 1 forks source link

Update non-essential Dockerfile elements for new repository structure #2

Closed alexdunnjpl closed 1 year ago

alexdunnjpl commented 1 year ago

Currently, requests is installed manually, package is manually installed, and repo is cloned from Github

💡 Description

tloubrieu-jpl commented 1 year ago

@alexdunnjpl we pull the package from an artifactory in docker images to make them as thin as possible, it comes from a recommendation that @nutjob4life made I think. We can discuss that. In that case we would push the package on pypi with the cicd and pull it from there in the docker image.

alexdunnjpl commented 1 year ago

Ah, gotcha - I may need to revert/alter that change then. Will wait for feedback from Sean

nutjob4life commented 1 year ago

Hi @tloubrieu-jpl @alexdunnjpl. I think my recommendation was made for Java-based projects which would do things like:

  1. FROM java
  2. COPY . /usr/app/src
  3. …install Apache Maven… (which is huge)
  4. …run mvn install… (which downloads 429 Maven plugins, which is huge)
  5. ENTRYPOINT whatever
  6. …and not even remove Apache Maven or the .m2 repository at the end

which results in gigabyte-sized images most of whose bytes are never actually executed at container time.

Python's a lot lighter weight and so doing pip install . instead of pip install package-1.2.3 (from artifactory) is a lot less of a concern.

(Besides: I often will do docker container exec and actually edit source code in the image in order to debug things! 🤫)