I have a docker file:
I’ve build it with:
docker image build --tag my-ubuntu .
I have a container out of that:
docker container create --interactive --tty --name my-ubuntu my-ubuntu
I can start and execute some commands: (bash is default)
docker start --interactive my-ubuntu
I can see output of commands.
Now I want to start it and pipe some commands:
echo ls && exit | docker start --interactive my-ubuntu
Problem: I don’t see
Where is the output of piped command?
Why I don’t use
docker exec? I will have a few of these images with different entry points, I don’t want my caller script to be aware of entry point of each container and pass it to
Source: Docker Questions