3 # This is a convenience script for reporting issues that include a base
4 # template of information. See https://github.com/docker/docker/pull/8845
8 DOCKER_ISSUE_URL=${DOCKER_ISSUE_URL:-"https://github.com/docker/docker/issues/new"}
9 DOCKER_ISSUE_NAME_PREFIX=${DOCKER_ISSUE_NAME_PREFIX:-"Report: "}
10 DOCKER=${DOCKER:-"docker"}
11 DOCKER_COMMAND="${DOCKER}"
14 # pulled from https://gist.github.com/cdown/1163649
15 function urlencode() {
19 for (( i = 0; i < length; i++ )); do
22 [a-zA-Z0-9.~_-]) printf "$c" ;;
23 *) printf '%%%02X' "'$c"
29 # this should always match the template from CONTRIBUTING.md
31 Description of problem:
35 `${DOCKER_COMMAND} -D version`
39 `${DOCKER_COMMAND} -D info`
46 Environment details (AWS, VirtualBox, physical, etc.):
70 function format_issue_url() {
71 if [ ${#@} -ne 2 ] ; then
74 local issue_name=$(urlencode "${DOCKER_ISSUE_NAME_PREFIX}${1}")
75 local issue_body=$(urlencode "${2}")
76 echo "${DOCKER_ISSUE_URL}?title=${issue_name}&body=${issue_body}"
80 echo -ne "Do you use \`sudo\` to call docker? [y|N]: "
84 if [ "x${use_sudo}" = "xy" -o "x${use_sudo}" = "xY" ]; then
85 export DOCKER_COMMAND="sudo ${DOCKER}"
88 echo -ne "Title of new issue?: "
92 issue_url=$(format_issue_url "${issue_title}" "$(template)")
94 if which xdg-open 2>/dev/null >/dev/null ; then
95 echo -ne "Would like to launch this report in your browser? [Y|n]: "
96 read -r -n 1 launch_now
99 if [ "${launch_now}" != "n" -a "${launch_now}" != "N" ]; then
100 xdg-open "${issue_url}"
104 echo "If you would like to manually open the url, you can open this link if your browser: ${issue_url}"