wilsonzlin/minify-html

Please provide a docker image

tacone opened this issue · 4 comments

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.

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.

Adding another build variation is probably too much (especially an entire Docker image for a tiny self-contained tool)

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 0.9.2 outputs nothing when I tried it 0.9.2-linux-x86_64 index.html. While building from source works. I don't know why that is, but if you produce static builds for linux with musl you'll also have a more portable binary on linux. This issue has happened before for the project on a different platform.

Perhaps it's due to the CI building from Ubuntu 18.04?:

os: [macos-11.0, ubuntu-18.04, windows-2019, self-hosted-linux-arm64, self-hosted-macos-arm64]


I think this can trivially be done manually anyway, by either copying the binary into the image or building from source if desired.

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 targe 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.