Interactive shell using Docker Compose

0 votes

I was trying to start an interactive shell in a container using docker compose only.

I tried something like this

myapp:
  image: alpine:latest
  entrypoint: /bin/sh

When I start this container using docker using docker compose, it exits immediately.

Can someone help me out?

Jul 26, 2018 in Docker by Hannah
• 18,520 points
6,970 views

1 answer to this question.

0 votes

You need to include the following lines in your docker-compose.yml:

stdin_open: true
tty: true
answered Jul 26, 2018 by Kalgi
• 52,340 points

Related Questions In Docker

+1 vote
5 answers

Set containers timezones by using docker compose.

version "2" services: serviceA: ...READ MORE

answered Jul 9, 2018 in Docker by Atul
• 10,240 points
24,883 views
0 votes
1 answer
+3 votes
4 answers

How do I execute multiple commands using docker-compose

It can be solve by using bash -c ...READ MORE

answered Sep 20, 2018 in Docker by shubham
• 7,340 points
114,046 views
0 votes
1 answer

Error: Deploying a docker-compose app on Kubernetes using Docker for Windows

Due to the lack of support for ...READ MORE

answered Oct 11, 2018 in Docker by Tyrion anex
• 8,700 points
1,613 views