Just add the following alias to your .bashrc (or .bash_profile in OSX):
alias yuicompressor='docker run --rm -v `pwd`:/workdir -w /workdir semenovp/tiny-yuicompressor:latest'
It repeats the original usage.
For example, do like this:
yuicompressor --type js -o output.js input.js
yuicompressor --type css -o output.css input.css
docker build --build-arg vcsref="$(git rev-parse --short HEAD)" -t semenovp/tiny-yuicompressor:latest .
Review the sizes of another yuicompressor
images retrieved from DockerHub against current one built on OpenJDK v1.8.0_171.
Note, the original openjdk:alpine is of 69.42Mb / 103Mb.
REPOSITORY | YYYY-MM-DD | COMPRESSED / UNCOMPRESSED SIZE |
---|---|---|
semenovp/tiny-yuicompressor:latest | 2020-12-03 | 35.66MB / 48MB |
nullmem/yuicompressor:latest | 2020-02-05 | 55.08MB / 83.8MB |
lapsatech/yuicompressor:latest | 2018-09-02 | 119.18MB / 312MB |
ruudk/yuicompressor:latest | 2014-05-12 | 157.73MB / 453MB |
fr3nd/yuicompressor:latest | 2018-09-09 | 433.67MB / 891MB |