7 : ${TOP_DIR:="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"}
9 source ${TOP_DIR}/docker/builder-include
12 echo "${name} - Builds the petitboot programs using a pb-builder container." >&2
13 echo "Usage: ${name} [flags]" >&2
14 echo "Option flags:" >&2
15 echo " -c --check - Run 'make check'." >&2
16 echo " -d --dry-run - Do not run docker commands." >&2
17 echo " -h --help - Show this help and exit." >&2
18 echo " -t --tag - Print Docker tag to stdout and exit." >&2
19 echo " -v --verbose - Verbose execution." >&2
20 echo "Environment:" >&2
21 echo " DOCKER_TAG - Default: '${DOCKER_TAG}'" >&2
28 long_opts="check,dry-run,help,tag,verbose"
30 opts=$(getopt --options ${short_opts} --long ${long_opts} -n "${name}" -- "$@")
33 echo "${name}: ERROR: Internal getopt" >&2
67 echo "${name}: ERROR: Internal opts" >&2
73 if [[ -n "${usage}" ]]; then
78 if [[ -n "${tag}" ]]; then
84 -u $(id -u):$(id -g) \
85 -v /etc/group:/etc/group:ro \
86 -v /etc/passwd:/etc/passwd:ro \
87 -v ${TOP_DIR}:/opt/pb \
91 if [[ -n "$verbose}" ]]; then
95 if [[ -n "${check}" ]]; then
96 docker_extra="make check"
102 run_cmd "docker run ${docker_args} ${DOCKER_TAG} /bin/bash \
104 -c './bootstrap && ./configure --with-ncurses && make && ${docker_extra}'"