From cb5435cee3fe5b3de11304a6c40649ccbe2024f7 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Mon, 20 Mar 2017 10:04:15 +0100 Subject: [PATCH] Initial commit. --- .dockerignore | 4 ++++ Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++ README.md | 17 +++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 README.md diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..52b5f5b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +.dockerignore +.git* +*.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e3b129c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +FROM alpine:3.5 + +# Permanent dependencies (runtime) +#RUN \ +# apk add --no-cache \ +# libpng + +# Dev & build +ARG GFLAGS_VERSION=v2.2.0 +ARG GUETZLI_VERSION=v1.0 +RUN \ + apk add --no-cache --virtual .build-deps \ + libpng-dev \ + alpine-sdk \ + git \ + coreutils \ + cmake \ + &&\ +\ + git clone "https://github.com/gflags/gflags.git" /var/tmp/gflags &&\ + (cd /var/tmp/gflags &&\ + git checkout "${GFLAGS_VERSION}" &&\ + mkdir build &&\ + cd build &&\ + cmake .. &&\ + make -j$(nproc) all install DESTDIR="/opt/build" \ + ) &&\ +\ + git clone "https://github.com/google/guetzli.git" /var/tmp/guetzli &&\ + (cd /var/tmp/guetzli &&\ + git checkout "${GUETZLI_VERSION}" &&\ + make -j$(nproc) config=release \ + TARGETDIR=/usr/local/bin \ + LDFLAGS="-L/opt/build/usr/local/lib -static" \ + CXXFLAGS="-I/opt/build/usr/local/include" \ + CFLAGS="-I/opt/build/usr/local/include" \ + CPPFLAGS="-I/opt/build/usr/local/include" \ + ) &&\ +\ + apk del --no-cache .build-deps &&\ + rm -rf /var/tmp/* /tmp/* /opt/build + +ENTRYPOINT ["guetzli"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..8155b71 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Guetzli Docker image + +This image includes a static build of Guetzli, the perceptual JPEG encoder made by Google. The entrypoint is configured to point directly at the binary +so it is possible to use `docker run` on this image just as if you would use guetzli directly on your system. + +## Available tags + +All available tags are always listed [in Docker Hub](https://hub.docker.com/r/icedream/guetzli/tags), the list below explains the maintained tags: + +- `latest`, `1`, `1.0`: Latest stable version. + +## Examples + +Running the encoder on an image on the host system: + + docker run --rm -it -v "$(pwd):/work" -w /work icedream/guetzli \ + example.jpg example_compressed.jpg