You can do anything with a shell script, and typically you could use tools like Ansible to provision them - that would be similar to Docker's Dockerfile.
Unlike shell script, you generally need to build Docker image only once though + it just feels faster and less cumbersome.
I just use Docker whenever I need to run something on multiple machines. It essentially runs the same shell script, but I don't have to care for making sure the environment for the shell script is compatible (i.e. distribution version, os package dependencies and so on)