-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add stage with minimal image #187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @reitzig , thanks a lot for this proposal!
Given this work, what do you think we update it to solve #79 ?
The proposal is the following:
- The minimal image should be name
asciidoctor/asciidoctor
and its tag should be the asciidoctor's version - The "kitchen sink" image, which is currently the
asciidoctor/docker-asciidoctor
image, should be now namedasciidoctor/box
If it is ok for you, I'll let you update the PR, and I'll create the associated Docker Repositories in the DockerHub?
What's the reasoning behind inclusion of asciidoctor-pdf in minimal image? |
I currently see that latest image is 233MB. Not sure though what has happened after 1.3.2 (450MB) that affected image size so much. UPD: #184 happened. |
@slonopotamus be careful as the size reported on the DockerHub are compressed sizes, while I understand that @reitzig is speaking in term of the size reported by the Docker Engine (uncompressed I assume): ➜ docker image ls | grep ascii
asciidoctor/docker-asciidoctor 1.3.3 a03ff86dd566 12 hours ago 452MB
➜ docker save asciidoctor/docker-asciidoctor:1.3.3 | gzip > adoc.gz
➜ du -sh adoc.gz
240M adoc.gz |
Can do. Do the maintainers agree about those tags?
Figured being able to generate PDFs would be prudent for a base image. |
I'm not really sure about adding or removing |
That's a tough call. There are reasonable arguments for or against including it. The argument against including it is that the base / minimal image should have only the Asciidoctor gem and nothing else so it's the absolute least common denominator. And while there's certainly a case to be made for that, it ends up being so minimal that you have to wonder why we would even need an image then because it's hardly different than the public Ruby image(s). The argument for including it is that the base / minimal image should provide tools for the most common publishing workflows. And for that, PDF is an absolute must. Like it or not, nearly everyone ends up needing PDF output for something. And since it only depends on a handful of other gems, it adds very little size to the image. You could definitely make the case to include it, but not include it's optional system dependencies, ghostscript and graphicsmagick (which aren't included anyway). I think the right decision is to include Asciidoctor PDF (at least until we have a suitable replacement). |
Thanks @mojavelinux for this clear explanation! I just had a thought about the versioning of the minimalistic image that could be an argument against adding Asciidoctor PDF: if we want to keep the image tag to the asciidoctor image, then it means that both the upstream distribution (OS version, ruby version) AND the for instance: given the image
WDYT? |
Yep, that's a good point. If you look at it that way, then yeah, Asciidoctor PDF should be in the box, not the base. |
Good point. So: what's the version of That said, I guess we could, in one swoop, provide an official, minimal |
I think the box image should have its own versioning scheme. |
I don't think there has to be only 2 images. We're just arguing that there shouldn't be just one. Maybe there needs to be a base, a mid-sized one that includes the major converters (PDF, EPUB3, reveal.js, etc), then the box that just provides it all. |
It's always going to be a tradeoff though. With so many interchangable parts, there's always someone who wants a unique combination, like someone who wants to make HTML with diagrams and nothing else. These are not meant to be the only images ever made. They are about providing a foundation and something turnkey. I don't really understand why we are quibbling over a few hundred MBs though. Does it really matter how big the image is (assuming what contains is actually useful and not just residual files from a build)? |
Not sure if it makes sense to maintain it in this here repo. The Dockerfile for Finally, maintain "box" in this here repo, maybe in different flavors, with its own versioning schema.
FWIW, I don't understand the |
When used in CI (often, caching uncertain) or rarely but locally (re-pull every time), it can make a difference. Of course, you can argue that in such scenarios people should tailor their own images; but then there's not a whole lot of a point to a kitchen-sink image, isn't there? Provide a reasonable base, as you say, on top of which it's easy for people to install the gems they need. 🤷 That said, this MR comes from a completely unnecessary bloat from ~450MB to ~1.5GB which the MR effectively negates. @dduportal had the idea of solving #79 en passant -- I now think that was maybe not the best idea, as the issues are ultimately unrelated and have very different stakeholders, or so it seems.
|
I don't like having Dockerfiles in the main repos. It mixes concerns. |
I don't think adding another way of delivery to a repo mixes concerns too much; many projects include multiple install artifacts. On the other hand, as the above discussion and in particular the versioning conundrum shows, maintaining Docker images for different tools resp. "stacks" in the same repository can become rather impractical. Anyway. This discussion is beyond my involvement in the project so I'll step out. Feel free to close the PR or adopt it, whatever your group decision is. Thanks! |
Hello @reitzig , thanks a lot for all this inputs and for this contribution. The
|
If it is OK for everyone, I'll merge this PR as it does not change anything on the final assets. A subsequent PR will come to adapt the minimalistic image to the new DockerHub image (setting the name and moving pdf back to the kitchen-sink image). |
Thanks a lot @reitzig! |
For simple use cases, a smaller image than the full ~450MB can suffice.
This MR adds a separate build stage with a minimal image of ~40MB that contains the bare minimum to run asciidoctor(-pdf); everything else would have to be added usage-site.