Closed sean0x42 closed 4 years ago
@brennerm could you please view the changes introduced to README.md
regarding Docker? This is my first time publishing a docker image, so if if anything smells please let me know.
Two comments regarding the Dockerfile:
Think about using a multistage Dockerfile. First stage would be to build the markdown-extract binary and the in the second stage you copy it over to something like an alpine or busybox image. This would decrease the image size by a significant amount. Reference: https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
Set the ENTRYPOINT to the markdown-extract binary and leave the CMD empty. This allows for easy use of your Docker image. You can take this Dockerfile as an example: https://hub.docker.com/r/hashicorp/terraform/dockerfile
Thanks for the ideas. I've got to spend some time on other things, but I will address these points soon hopefully
Wow @brennerm, it's crazy how the multi-stage build reduces file size... I've managed to get it down to just 70mb. I did some experimentation and I think I could get it even lower with alpine as you suggested, but presently I run into some compilation errors so I think I'll leave that problem for another day.
Edit: Just opened a new ticket to track this #7
Thanks for your short-term improvements. Will now happily use markdown-extract in my CI pipeline. :+1:
This pull request allows users to pull a docker image of
markdown-extract
.The docker image has been uploaded to hub.docker.com, and should now automatically rebuild whenever code is pushed to
master
.https://hub.docker.com/r/sean0x42/markdown-extract
Closes #2.