-
Notifications
You must be signed in to change notification settings - Fork 36
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
Please provide a docker image #30
Comments
i can't install it on docker !! |
Adding another build variation is probably too much (especially an entire Docker image for a tiny self-contained tool), and I think this can trivially be done manually anyway, by either copying the binary into the image or building from source if desired. |
It would actually provide a CLI equivalent option that is supported across platforms, instead of requiring to pull a platform specific binary from releases, everyone could use the same Docker image. That's useful for users. It's also useful for you, as you can ensure you release the CLI tool with a much more reliable way to reproduce a testing environment, and run your tests against that in the CI. The current x86_64 linux binary Perhaps it's due to the CI building from Ubuntu 18.04?: minify-html/.github/workflows/cli.yml Line 14 in 284f908
Building from source isn't immediately obvious for others. I'm used to building a rust project, but was a bit confused about needing to run a script that uses NodeJS to prepare that build, especially since this project has multiple other build variants unrelated to the CLI including a NodeJS package. When the binary isn't working like in my experience, copying it into the Docker image isn't going to be very helpful. It's far better when your project automates the build for releases with a Dockerfile, where you're able to publish an official release on DockerHub that is trusted, and tested by your own CI. You could then take the binary built from the image to distribute directly for Linux if you like. |
Thanks @polarathene, those are good points raised. I'll reopen this issue for tracking the Docker image. I've had issues in the past with cross-platform compatibility due to glibc (#12 #25 #78 #79 #88), but was required to target it due to bundling with esbuild-rs which includes the Cgo runtime and requires glibc. Now that I've replaced it with a Rust-based JS minifier I wrote from scratch, it should be possible to target musl and create fully static CLI binaries. Note that the issue mentioned (#6) was due to a bug in the parser itself, not the underlying libc and platform issues. |
I wanted to add, that a docker image is also useful for running the tool on CI, which could make sense for anyone that uses static site generators on e.g. GH Pages, as a post-processing step, and .. that is a huge potential clientele! |
Not only for static sites. In our Django websites, we minify the HTML during the build step. So our templates are full of comments and other useful stuff, but when deploying, we use html-minifier to reduce the size of all templates and especially remove all our internal comments.
Furthermore we also validate this step with a pre-commit stage:
All this was very easy to set up because the CLI is available with a simple npm install. For now we decided to stick to html-minifier for that... |
Providing a Docker image on Docker Hub may allow users to grab the latest binaries via a multistage build without the need to hit your website every time they build.
The text was updated successfully, but these errors were encountered: