11 ms·
So would just be: docker-compose exec web /bin/bash Saves having to add --service-ports
by nodesocket 7y ago
So would just be:
docker-compose exec web /bin/bash
Saves having to add --service-ports
- castis 7y agoexec only works on specific running containers so you'll need the container id for this exec -ti f635776c2d08 /bin/bash i do this often enough that i keep this in a makefile so i can do it by image name docker exec -ti `docker ps | grep 'container-name' | awk '{print $$1}'` /bin/bash
- yjftsjthsd-h 7y agoYou only need to specify the container by ID if you're using docker directly; if you use docker-compose then you can use the service name and you don't need the `-ti`