I've noticed that many entrypoint.sh scripts for docker do something like this:
#!/bin/bash set -e ... code ... exec "$@"
What are the set -e and the exec "$@" for?
set -e
exec "$@"
It basically takes any command line arguments passed to entrypoint.sh and execs them as a command. The intention is basically "Do everything in this .sh script, then in the same shell run the command the user passes in on the command line".
entrypoint.sh
See:
1.4m articles
1.4m replys
5 comments
57.0k users