When working on a Dockerfile I often need to open a bash inside the generated container in order to check what the Dockerfile has generated.
This requires 3 steps:
- running
docker ps
- checking the container id that we need (usually based on the image name)
- running
docker exec -i -t <container_id> bash
This script does this in one step: dockerbash <image_name>
Put in on a directory and load it from your ~/.bashrc
source ~/bash_functions/dockerbash.sh