I want to write the equivalent of the following in docker-compose.yaml.
How can I do that?
docker run -it myImage You actually have 2 flags:
So we just need to find the right keys to put in docker-compose.yaml (tty & stdin_open)
version: "3.9" #you can put you own version services: yourServiceName: image: yourImageName tty: true # equivalent for -t stdin_open: true # equivalent for -i Now you can use docker-compose up to run your container (or docker-compose start if you already have a created container)
More info about other flags (LINK)