RANGER-4942: Fix Dockerfiles of ./build_ranger_using_docker.sh
What changes were proposed in this pull request?
This PR fixes some syntactic mistakes on the Dockerfiles involved in the Ranger build in a Dockerized environment. The 3 main issues I have fixed are:
-
RUN if [ "${OS_NAME}" == "UBUNTU" ]; then ...: the commands enclosed in this if-condition will never be executed because the shell used for this command is/bin/sh, which requires a single=for string comparison. -
For some reasons, the
ENV JAVA_HOME /usr/lib/...Dockerfile command is placed inside theRUNcommand. I put it before theRUNcommand in order to use theJAVA_HOMEenv variable in the shell script. -
Many env variables are initialized using the alternative syntax
ENV MY_ENV_VAR value1, which is not compliant with the guidelines, that suggests usingENV MY_ENV_VAR=value1. I quote from theENVreference:The alternative syntax is supported for backward compatibility, but discouraged for the reasons outlined above, and may be removed in a future release.
I rewrote only some of them, in case you preferred another PR for a general Dockerfile/compose improvements.
How was this patch tested?
By running ./build_ranger_using_docker.sh