I've just spend so much time to found out the answer to my question by myself and it was kinda simple but i would like to know if anyone can explain me why it worked only like the following.
To resume I wanted to run a docker-compose over an ssh command from gitlab ci cd runner to my amazon ec2 ami and only the following command worked =>
ssh -o StrictHostKeyChecking=no -i $sshKey $user@$host 'docker-compose -v'
I've tried with double quote : ssh -o StrictHostKeyChecking=no -i $sshKey $user@$host "docker-compose -v"
no quote :
ssh -o StrictHostKeyChecking=no -i $sshKey $user@$host docker-compose -v
and for exemple when i try to run the command under windows terminal i got no issue running it with double quote ...