#!/bin/bash # get the container name from the current working directory IMG_NAME=$(basename $(pwd)) docker build -t $IMG_NAME . echo "In the image do:" echo " cd /tmp" echo " ls -l" echo " cat greetings.txt" docker run --rm -it $IMG_NAME # can also string together commands to execute at container-start # docker run --rm -it $IMG_NAME sh -c "cat /tmp/greetings.txt; ls -l /tmp/greetings.txt"