I have a docker image in which I want to run the following command :
echo \"1\" > /tmp/service.cfg
/bin/bash
I found the solution, I needed to run the sh command with the -c flag like this :
sh
-c
docker run -i -t debian:latest sh -c 'echo "1" > /tmp/service.cfg && cat /tmp/service.cfg'
This returns 1 as expected...