When I start a container as following:
docker run --name test -itd busybox
I can attach to it with:
docker attach test
I can now execute commands, such as ls
, and see the results. Great!
Now, I want to start my container via a docker-compose.yml
instead. I tried with:
version: "3.7"
services:
busybox:
image: busybox
tty: true
With this, when I attach to the container again with docker attach <container id>
, I seem to be able to "connect" to it, but I don't see any output when executing a command (for example ls
).
Why is that? How can I fix this?