uci-docker-build/core/opt/bin/entrypoint
David Kebler ca857a032a new: add core RUN step
refactored: Dockefile template
refactor: example and move src/ there a simple example
new: distros.csv holds table of valid distros, their images and install/update commands
refactor: various fixes and adjustment in response to above
refactor: help vastly improved and updated
2023-04-22 08:19:45 -07:00

41 lines
No EOL
730 B
Bash
Executable file

#!/bin/bash
source /opt/core_run.env
case "$1" in
maphostid)
shift 1
/bin/bash -l -c '$BIN_DIR/map-host-id $@' $0 "$@"
;;
image)
shift 1
/bin/bash -l -c '$BIN_DIR/image-info $@' $0 "$@"
;;
shell)
shift 1
_shell_=/bin/bash
[[ $1 ]] && _shell_="/bin/su $1"
$_shell_ -c "cd ${INITIAL_DIR:-/opt}; exec bash -l"
;;
help)
$BIN_DIR/entrypoint-help
;;
script)
shift 1
cat | /bin/bash -l
;;
${ENTRYPOINT_CMD:-start})
shift 1
/bin/bash -l -c '${ENTRYPOINT_CMD_PATH:-$BIN_DIR/start} $@' $0 "$@"
;;
*)
echo command passed to container "$*"
if [ -n "$*" ]; then
if ! /bin/bash -l -c '$@' $0 "$@" ; then
$BIN_DIR/entrypoint-help
fi
else
echo no command was passed to entrypoint
echo
$BIN_DIR/entrypoint-help
fi
;;
esac