You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2022/11/23 23:51:14 UTC

[impala] branch master updated: IMPALA-11741: Verify that 'hostname' is installed in Docker images

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

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 52956bae1 IMPALA-11741: Verify that 'hostname' is installed in Docker images
52956bae1 is described below

commit 52956bae141acf2ecdd7b28ff7edb4d2f2fe3f10
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Wed Nov 23 10:32:54 2022 -0800

    IMPALA-11741: Verify that 'hostname' is installed in Docker images
    
    Some deployments rely on having the 'hostname' utility
    installed in Impala's Docker image (e.g. for constructing
    daemon startup arguments). Most distributions include it
    by default, but Redhat UBI8 does not.
    
    This adds 'hostname' to the list of installed packages
    for both Ubuntu and the Redhat family. This also verifies
    that 'hostname' runs properly.
    
    Testing:
     - Verified that this adds hostname for UBI8 images
    
    Change-Id: I5a760680294a3ad7e74e843d3f4c06cd38819e88
    Reviewed-on: http://gerrit.cloudera.org:8080/19273
    Reviewed-by: Wenzhe Zhou <wz...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 docker/install_os_packages.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docker/install_os_packages.sh b/docker/install_os_packages.sh
index 0a0cb6ecb..2f7e28ef0 100755
--- a/docker/install_os_packages.sh
+++ b/docker/install_os_packages.sh
@@ -91,6 +91,7 @@ if [[ $DISTRIBUTION == Ubuntu ]]; then
     apt-get install -y openjdk-8-jre-headless
   fi
   apt-get install -y \
+      hostname \
       krb5-user \
       language-pack-en \
       libsasl2-2 \
@@ -120,6 +121,7 @@ elif [[ $DISTRIBUTION == Redhat ]]; then
   yum install -y --disableplugin=subscription-manager \
       cyrus-sasl-gssapi \
       cyrus-sasl-plain \
+      hostname \
       krb5-workstation \
       openldap-devel \
       tzdata
@@ -154,6 +156,11 @@ if ! locale -a | grep en_US.utf8 ; then
   exit 1
 fi
 
+if ! hostname ; then
+  echo "ERROR: 'hostname' command failed."
+  exit 1
+fi
+
 # Impala will fail to start if the permissions on /var/tmp are not set to include
 # the sticky bit (i.e. +t). Some versions of Redhat UBI images do not have
 # this set by default, so specifically set the sticky bit for both /tmp and /var/tmp.