This is an automated email from the ASF dual-hosted git repository.
aw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yetus.git
The following commit(s) were added to refs/heads/master by this push:
new 0f54f6f YETUS-845. shrink the docker image by fixing cabal
0f54f6f is described below
commit 0f54f6f5fd8c1afe3ea8e203e217efd6dcb2e841
Author: Allen Wittenauer <[email protected]>
AuthorDate: Sat Apr 6 10:14:51 2019 -0700
YETUS-845. shrink the docker image by fixing cabal
Signed-off-by: Allen Wittenauer <[email protected]>
---
precommit/src/main/shell/test-patch-docker/Dockerfile | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/precommit/src/main/shell/test-patch-docker/Dockerfile
b/precommit/src/main/shell/test-patch-docker/Dockerfile
index 7fe612f..3d0fd7c 100644
--- a/precommit/src/main/shell/test-patch-docker/Dockerfile
+++ b/precommit/src/main/shell/test-patch-docker/Dockerfile
@@ -37,12 +37,15 @@ ENV DEBCONF_TERSE true
######
# Install some basic Apache Yetus requirements
# some git repos need ssh-client so do it too
+# Adding libffi-dev for all the programming languages
+# that take advantage of it.
######
RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
apt-transport-https \
ca-certificates \
curl \
git \
+ libffi-dev \
locales \
pkg-config \
rsync \
@@ -210,13 +213,18 @@ ENV BUNDLE_PATH /var/tmp/.bundler-gems
####
# Install shellcheck (shell script lint)
+# NOTE: A bunch of stuff is removed to shrink the size of the Docker image
+# Be very careful changing the code here, layer size may grow very large!
####
RUN apt-get -q update && apt-get -q install --no-install-recommends -y
cabal-install \
&& apt-get clean \
- && rm -rf /var/lib/apt/lists/*
-RUN cabal update
-RUN cabal install ShellCheck \
- && cp -p /root/.cabal/bin/shellcheck /usr/local/bin/shellcheck
+ && rm -rf /var/lib/apt/lists/* \
+ && cabal update \
+ && cabal install -j ShellCheck \
+ && cp -p /root/.cabal/bin/shellcheck /usr/local/bin/shellcheck \
+ && apt remove -y ghc cabal-install \
+ && apt autoremove -y \
+ && rm -rf /root/.cabal
###
# Install hadolint