uci-docker-build/Dockerfile.d/init/entrypoint.tpl

29 lines
539 B
Smarty

#!/bin/bash
# to maintain variable $ in container script espcape with \$
# otherwise subtitution will happen during build
case "\$1" in
maphostid)
shift 1
/bin/bash -l -c '\$BIN_DIR/map-host-id \$@' \$0 "\$@"
;;
shell)
/bin/bash -c "cd \${INITIAL_DIR:-/opt}; exec bash -l"
;;
help)
.INCLUDE ./init/help.sh
;;
image)
.INCLUDE ./init/image-info.sh
;;
script)
shift 1
cat | /bin/bash -l
;;
${ENTRYPOINT_CMD:-start})
shift 1
/bin/bash -l -c '${ENTRYPOINT_CMD_PATH:-$BIN_DIR/start} \$@' \$0 "\$@"
;;
*)
/bin/bash -l -c '"\$@"' \$0 "\$@"
;;
esac