From 2520806df263c0137617bc2449e3c46178e9515c Mon Sep 17 00:00:00 2001
From: Scott Wittenburg <scott.wittenburg@kitware.com>
Date: Fri, 13 Dec 2019 11:22:21 -0700
Subject: [PATCH] docker: add `file`, adjust locale, and use python3 for ubuntu
 (#13508)

* docker: add missing module to ubuntu images
* docker: fix issue with missing locale
* docker: one package per line + rm python2 support
* docker: ubuntu image also needs 'file' for buildcache creation
---
 share/spack/docker/ubuntu-1604.dockerfile | 36 ++++++++++++++++++-----
 share/spack/docker/ubuntu-1804.dockerfile | 36 ++++++++++++++++++-----
 2 files changed, 56 insertions(+), 16 deletions(-)

diff --git a/share/spack/docker/ubuntu-1604.dockerfile b/share/spack/docker/ubuntu-1604.dockerfile
index eb30ab8a8d..7d57f76c7f 100644
--- a/share/spack/docker/ubuntu-1604.dockerfile
+++ b/share/spack/docker/ubuntu-1604.dockerfile
@@ -17,16 +17,36 @@ COPY share $SPACK_ROOT/share
 COPY var   $SPACK_ROOT/var
 RUN mkdir -p $SPACK_ROOT/opt/spack
 
-RUN apt-get -yqq update                                   \
- && apt-get -yqq install                                  \
-        build-essential ca-certificates curl       g++    \
-        gcc             gfortran        git        gnupg2 \
-        iproute2        lmod            lua-posix  make   \
-        openssh-server  python          python-pip tcl    \
-        unzip                                             \
- && pip install boto3                                     \
+RUN apt-get -yqq update                           \
+ && apt-get -yqq install --no-install-recommends  \
+        build-essential                           \
+        ca-certificates                           \
+        curl                                      \
+        file                                      \
+        g++                                       \
+        gcc                                       \
+        gfortran                                  \
+        git                                       \
+        gnupg2                                    \
+        iproute2                                  \
+        lmod                                      \
+        locales                                   \
+        lua-posix                                 \
+        make                                      \
+        openssh-server                            \
+        python3                                   \
+        python3-pip                               \
+        tcl                                       \
+        unzip                                     \
+ && locale-gen en_US.UTF-8                        \
+ && pip3 install boto3                            \
  && rm -rf /var/lib/apt/lists/*
 
+# Add LANG default to en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LC_ALL en_US.UTF-8
+
 RUN ( echo ". /usr/share/lmod/lmod/init/bash"                       \
  &&   echo ". \$SPACK_ROOT/share/spack/setup-env.sh"                \
  &&   echo "if [ \"\$CURRENTLY_BUILDING_DOCKER_IMAGE\" '!=' '1' ]"  \
diff --git a/share/spack/docker/ubuntu-1804.dockerfile b/share/spack/docker/ubuntu-1804.dockerfile
index e8447b7daa..9b3be21bec 100644
--- a/share/spack/docker/ubuntu-1804.dockerfile
+++ b/share/spack/docker/ubuntu-1804.dockerfile
@@ -17,16 +17,36 @@ COPY share $SPACK_ROOT/share
 COPY var   $SPACK_ROOT/var
 RUN mkdir -p $SPACK_ROOT/opt/spack
 
-RUN apt-get -yqq update                                   \
- && apt-get -yqq install                                  \
-        build-essential ca-certificates curl       g++    \
-        gcc             gfortran        git        gnupg2 \
-        iproute2        lmod            lua-posix  make   \
-        openssh-server  python          python-pip tcl    \
-        unzip                                             \
- && pip install boto3                                     \
+RUN apt-get -yqq update                           \
+ && apt-get -yqq install --no-install-recommends  \
+        build-essential                           \
+        ca-certificates                           \
+        curl                                      \
+        file                                      \
+        g++                                       \
+        gcc                                       \
+        gfortran                                  \
+        git                                       \
+        gnupg2                                    \
+        iproute2                                  \
+        lmod                                      \
+        locales                                   \
+        lua-posix                                 \
+        make                                      \
+        openssh-server                            \
+        python3                                   \
+        python3-pip                               \
+        tcl                                       \
+        unzip                                     \
+ && locale-gen en_US.UTF-8                        \
+ && pip3 install boto3                            \
  && rm -rf /var/lib/apt/lists/*
 
+# Add LANG default to en_US.UTF-8
+ENV LANGUAGE en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV LC_ALL en_US.UTF-8
+
 RUN ( echo ". /usr/share/lmod/lmod/init/bash"                       \
  &&   echo ". \$SPACK_ROOT/share/spack/setup-env.sh"                \
  &&   echo "if [ \"\$CURRENTLY_BUILDING_DOCKER_IMAGE\" '!=' '1' ]"  \
-- 
GitLab