Sunday, February 2, 2020


When you want pass a parameter to exec docker instruction, you must used heredoc format in bash 



#!/bin/bash

export variable="value second parameter"
export log=./log

docker exec  -i dockernamecontainer /bin/bash  <<EOF > $log/logfile.log 2>&1  &
cd /python/; python  app.py firstparameter "$variable"
exit
EOF


the $variable is interpreted by heredoc format and replace command as
cd /python/; python  app.py firstparameter value second parameter