0

i have several containers in my docker-compose.yml before docker-compose one of my container run as

docker run -p 8080:8080 -i imagename:tag 

i have added this container in my docker-compose like this

myservice:
   image: imagename:tag
   ports:
     - "8080:8080"

now my question is how can i add the -i in docker-compose i do understand that we can do something like docker-compose up -i but i am using sbt-docker-compose for docker-compose up -> they provide dockerComposeUp but when i try to add dockerComposeUp -i it ends up with error

[error] Expected '-useStaticPorts'
[error] dockerComposeUp -i
[error]        
swaheed
  • 3,671
  • 10
  • 42
  • 103
  • Does this answer your question? [Interactive shell using Docker Compose](https://stackoverflow.com/questions/36249744/interactive-shell-using-docker-compose) – tgogos Mar 05 '20 at 13:14
  • thanks for responding but it did not solved my problem – swaheed Mar 05 '20 at 13:20

1 Answers1

0

The -i is for interactive shell, you can use this usually when you need to connect and interact with the docker container (a good example you would like to execute shell commands inside the docker container) and usually, you don't need this option with docker-compose.

If you would like to connect to the container after creating it, you can use the following command

docker exec -it ${container_nsme} sh

The error that you get is totally different thing, it seems that the dockerComposeUp tool is missing an argument, maybe you can try the following command

dockerComposeUp -useStaticPorts
Al-waleed Shihadeh
  • 2,697
  • 2
  • 8
  • 22