If you’re using Docker Composer in your project:
docker-compose exec <service_name> bash
Code language: Bash (bash)
Or, if you want to get into any kind of container:
docker exec <container_name_or_id> bash
Code 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/
Leave a Reply