diff --git a/Docker/Dockerfile b/Docker/Dockerfile
index ee2faff05b0501c3a8b85651b028c146d419ddb2..86aac9e5656afcf05835a56ed71722939d1139bf 100644
--- a/Docker/Dockerfile
+++ b/Docker/Dockerfile
@@ -42,8 +42,12 @@ ENV PROJ_LIB=/app/otb/share/proj
 ENV PATH=/app/otb/bin:$PATH
 ENV LD_LIBRARY_PATH=/app/otb/lib:$LD_LIBRARY_PATH
 ENV OTB_APPLICATION_PATH=/app/otb/lib/otb/applications
-ENV OTB_INSTALL_DIR=/app/otb
 ENV LC_NUMERIC=C
+ENV OTB_INSTALL_DIR=/app/otb
+
+# run post install to apply sed commands on cmake files and to get python
+# bindings if needed
+RUN sh /app/otb/tools/post_install.sh
 
 # Default command when using 'docker run' or 'docker create'
 RUN sh /app/otb/tools/post_install.sh && sh /app/otb/recompile_bindings.sh
diff --git a/Docker/system-dependencies.txt b/Docker/system-dependencies.txt
index e893cf738ec2bb407176dc2ae1eaa8f0d7a52e1a..eb810859f790cc5cf0fbe2d4dbf1b6e6e0fbf907 100644
--- a/Docker/system-dependencies.txt
+++ b/Docker/system-dependencies.txt
@@ -9,4 +9,4 @@ gcc
 g++
 swig
 findutils
-file
\ No newline at end of file
+file
diff --git a/Packaging/Files/otbenv.profile b/Packaging/Files/otbenv.profile
index d4bc61c5b5db65a7dd07afe3c0aec3ac64e2d77a..00115064daef186ec3c72c5f1306633d8028051e 100644
--- a/Packaging/Files/otbenv.profile
+++ b/Packaging/Files/otbenv.profile
@@ -72,13 +72,13 @@ fi
 LC_NUMERIC=C
 
 # set GDAL_DATA variable used by otb application
-GDAL_DATA=$OTB_INSTALL_DIR/share/gdal
+GDAL_DATA="$OTB_INSTALL_DIR/share/gdal"
 
-PROJ_LIB=$OTB_INSTALL_DIR/share/proj
+PROJ_LIB="$OTB_INSTALL_DIR/share/proj"
 
 export GDAL_DRIVER_PATH=disable
 
-export LD_LIBRARY_PATH=$OTB_INSTALL_DIR/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH="$OTB_INSTALL_DIR/lib:$LD_LIBRARY_PATH"
 
 # export variables
 export LC_NUMERIC
@@ -91,9 +91,9 @@ export OTB_INSTALL_DIR
 
 # The first time after install, run that script to patch cmake files with the right install path. This cannot be done until OTB is installed
 # This call permits to the user not to launch this by hand
-if [ ! -e $OTB_INSTALL_DIR/tools/install_done.txt ]
+if [ ! -e "$OTB_INSTALL_DIR"/tools/install_done.txt ]
 then
-  source $OTB_INSTALL_DIR/tools/post_install.sh
+  source "$OTB_INSTALL_DIR"/tools/post_install.sh
 else
   echo "**** OTB environment setup complete ****"
 fi