You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2022/03/29 09:51:19 UTC

[libcloud-site] 01/04: Update docker build script so it also optimizes images.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/libcloud-site.git

commit ea58bbc6bbcfde91b9d4219f057a73e59767d295
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Mar 29 11:23:15 2022 +0200

    Update docker build script so it also optimizes images.
---
 Dockerfile                   | 2 ++
 scripts/docker-build-site.sh | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 5d09998..edcca03 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -40,6 +40,8 @@ RUN \
   apt-get install -y --no-install-recommends build-essential \
     # Needed for jekyll compressor plugin
     openjdk-17-jdk \
+    # Needed for image asset compression
+    optipng jpegoptim \
     git && \
  apt-get clean
 
diff --git a/scripts/docker-build-site.sh b/scripts/docker-build-site.sh
index 4e5dc5d..c35128e 100755
--- a/scripts/docker-build-site.sh
+++ b/scripts/docker-build-site.sh
@@ -18,7 +18,7 @@
 IMAGE_NAME="libcloud-site-dev"
 
 docker build --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" -f Dockerfile -t "${IMAGE_NAME}" . --progress=plain
-docker run --rm -v "$(pwd)":/home/jekyll/site -it "${IMAGE_NAME}" bash -l -c "cd source; bundle exec jekyll build"
+docker run --rm -v "$(pwd)":/home/jekyll/site -it "${IMAGE_NAME}" bash -l -c "pushd source; bundle exec jekyll build; popd; ./scripts/optimize-images.sh"
 
 rsync -vurt --delete --exclude=".git/" --exclude="*.log" source/_site/* output/
 rm -rf source/_site