Dockerfile uses the CMD command, which allows you to set default values ββfor the container that is running.
The line below will execute script /srv/www/bin/gunicorn.sh , since it already provides the Dockerfile value in the CMD instruction in your Dockerfile , which is executed inside /bin/sh -c /srv/www/bin/gunicorn.sh at run time /bin/sh -c /srv/www/bin/gunicorn.sh .
docker run --name test test/test-backend
Now tell me if you want to run something else, just add this to the end of docker run . Now below the line you should run bash .
docker run --name test test/test-backend /bin/bash
Link: Best Dockerfile Recommendations
source share