Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Include Plugin modules in docker image #1458
This fixes #1455 per discussion there.
First, I've updated the docker image to the latest python alpine image at the time, 3.8.1-alpine3.11. Not sure what kind of testing would be required to ensure this is working correctly, but with it I was able to build a site and run the built-in server via the container. I was also able to run the same "test" command used in your CI publish task. Not sure if there's any deeper testing you'd want to do there.
I added a pip install command to the existing run block for the two plugin modules that the theme supported. I could have added an additional RUN step instead of adding onto the existing one, I decided to add on since you'd already grouped it into one mega command instead of separating them.
I've also removed mkdocs-minify-plugin from requirements.txt, because it's not a requirement for the base module. The module itself is using requirements.txt, so this will change the dependencies of the installed module as well. You mentioned in the issue to add the install commands at the same place as the existing pip install, except there's no pip install in the current Dockerfile, the requirements are installed as part of running
Finally, I added a .dockerignore file, based on this comment on a docker build issue. Without this, the docker engine reads every file in the directory to pass it to the build daemon, and there are thousands of node files that ultimately aren't used by docker, so this speeds up the build of the image significantly, at least on windows.
The image grew a bit, the current image is 117MB on my machine, whereas this one is 184 after building. The python base image grew from 79.1MB to 109MB as a result of the version change. The rest of the growth is from the
Happy to make any revisions to this that you'd like.