A docker image giving the built version of the best image optimizing CLI apps together with image_optim
to rule them all
95% of this work it's from rhardih's first attempt at dockerizing this project.
- Maintaining an additional Dockerfiles with fewer layers for production purposes
- creating more layers, so if you need to test different versions you can avoid full rebuilds.
- Versions have been bumped, and ordered alphabetically
Execute image_optim in your current dir:
docker run --rm -ti -v $(pwd):/images/ denji/docker-image_optim image_optim -r .
docker run --rm -ti \
# Add whatever image directory you like
# -v $(cd && cd images && pwd):/images/ \
-v $(pwd)/config:/root/.config/ \
denji/docker-image_optim sh
Then a simple cd /images && image_optim -r .
would optimize all the images in the mounted path.
docker build -t image_optim .
and (after a while) you can run your custom-built image
docker run --rm -ti \
# Add whatever image directory you like
# -v $(cd && cd images && pwd):/images/ \
-v $(pwd)/config:/root/.config/ \
docker-image_optim sh
A demo configuration (LOSSY!) can be found in config/image_optim.yml, all the options are listed here
A serious shrink in footprint has been achieved squashing all the RUN layers into one.
The drawback is having to maintain 2 Dockerfiles
$ docker images
REPOSITORY TAG SIZE
denji/docker-image_optim dev 365MB
denji/docker-image_optim latest 93.8MB