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

  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
• 14,080 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 35,800 points

Related Questions In Docker

+1 vote
5 answers

Set containers timezones by using docker compose.

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

answered Jul 8, 2018 in Docker by Atul
• 10,200 points
0 votes
1 answer
+1 vote
3 answers
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,120 points
0 votes
2 answers

How to edit file after I shell to a docker container?

You can even install it using a ...READ MORE

answered Apr 23 in Docker by Ashish
0 votes
1 answer

How to get docker-compose to always re-create containers from fresh images?

The containers are getting recreated to preserve ...READ MORE

answered Jul 27, 2018 in Docker by Kalgi
• 35,800 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.