Get into a Docker Container’s Shell

If you’re using Docker Composer in your project:

docker-compose exec <service_name> bashCode language: Bash (bash)

Or, if you want to get into any kind of container:

docker exec <container_name_or_id> bashCode language: Bash (bash)

According to your system needs, you might need to add “-it” flag after “exec” parameter.

Reference URLs:
1. https://docs.docker.com/engine/reference/commandline/compose_exec/
2. https://docs.docker.com/engine/reference/commandline/exec/


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.