Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2016
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.89 KB | None | 0 0
  1. Step 5 : RUN curl -sL https://deb.nodesource.com/setup_6.x
  2. ---> Running in ae42c12b202c
  3. #!/bin/bash
  4.  
  5. # Discussion, issues and change requests at:
  6. # https://github.com/nodesource/distributions
  7. #
  8. # Script to install the NodeSource Node.js v6.x repo onto a
  9. # Debian or Ubuntu system.
  10. #
  11. # Run as root or insert `sudo -E` before `bash`:
  12. #
  13. # curl -sL https://deb.nodesource.com/setup_6.x | bash -
  14. # or
  15. # wget -qO- https://deb.nodesource.com/setup_6.x | bash -
  16. #
  17.  
  18. export DEBIAN_FRONTEND=noninteractive
  19.  
  20. print_status() {
  21. echo
  22. echo "## $1"
  23. echo
  24. }
  25.  
  26. bail() {
  27. echo 'Error executing command, exiting'
  28. exit 1
  29. }
  30.  
  31. exec_cmd_nobail() {
  32. echo "+ $1"
  33. bash -c "$1"
  34. }
  35.  
  36. exec_cmd() {
  37. exec_cmd_nobail "$1" || bail
  38. }
  39.  
  40.  
  41. setup() {
  42.  
  43. print_status "Installing the NodeSource Node.js v6.x repo..."
  44.  
  45.  
  46. PRE_INSTALL_PKGS=""
  47.  
  48. # Check that HTTPS transport is available to APT
  49. # (Check snaked from: https://get.docker.io/ubuntu/)
  50.  
  51. if [ ! -e /usr/lib/apt/methods/https ]; then
  52. PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https"
  53. fi
  54.  
  55. if [ ! -x /usr/bin/lsb_release ]; then
  56. PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release"
  57. fi
  58.  
  59. if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then
  60. PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl"
  61. fi
  62.  
  63. # Populating Cache
  64. print_status "Populating apt-get cache..."
  65. exec_cmd 'apt-get update'
  66.  
  67. if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then
  68. print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..."
  69. # This next command needs to be redirected to /dev/null or the script will bork
  70. # in some environments
  71. exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1"
  72. fi
  73.  
  74. DISTRO=$(lsb_release -c -s)
  75.  
  76. check_alt() {
  77. if [ "X${DISTRO}" == "X${2}" ]; then
  78. echo
  79. echo "## You seem to be using ${1} version ${DISTRO}."
  80. echo "## This maps to ${3} \"${4}\"... Adjusting for you..."
  81. DISTRO="${4}"
  82. fi
  83. }
  84.  
  85. check_alt "Kali" "sana" "Debian" "jessie"
  86. check_alt "Debian" "stretch" "Debian" "jessie"
  87. check_alt "Linux Mint" "maya" "Ubuntu" "precise"
  88. check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
  89. check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
  90. check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
  91. check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
  92. check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
  93. check_alt "LMDE" "betsy" "Debian" "jessie"
  94. check_alt "elementaryOS" "luna" "Ubuntu" "precise"
  95. check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
  96. check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
  97. check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
  98. check_alt "BOSS" "anokha" "Debian" "wheezy"
  99. check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
  100. check_alt "Tanglu" "chromodoris" "Debian" "jessie"
  101.  
  102. if [ "X${DISTRO}" == "Xdebian" ]; then
  103. print_status "Unknown Debian-based distribution, checking /etc/debian_version..."
  104. NEWDISTRO=$([ -e /etc/debian_version ] && cut -d/ -f1 < /etc/debian_version)
  105. if [ "X${NEWDISTRO}" == "X" ]; then
  106. print_status "Could not determine distribution from /etc/debian_version..."
  107. else
  108. DISTRO=$NEWDISTRO
  109. print_status "Found \"${DISTRO}\" in /etc/debian_version..."
  110. fi
  111. fi
  112.  
  113. print_status "Confirming \"${DISTRO}\" is supported..."
  114.  
  115. if [ -x /usr/bin/curl ]; then
  116. exec_cmd_nobail "curl -sLf -o /dev/null 'https://deb.nodesource.com/node_6.x/dists/${DISTRO}/Release'"
  117. RC=$?
  118. else
  119. exec_cmd_nobail "wget -qO /dev/null -o /dev/null 'https://deb.nodesource.com/node_6.x/dists/${DISTRO}/Release'"
  120. RC=$?
  121. fi
  122.  
  123. if [[ $RC != 0 ]]; then
  124. print_status "Your distribution, identified as \"${DISTRO}\", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support"
  125. exit 1
  126. fi
  127.  
  128. if [ -f "/etc/apt/sources.list.d/chris-lea-node_js-$DISTRO.list" ]; then
  129. print_status 'Removing Launchpad PPA Repository for NodeJS...'
  130.  
  131. exec_cmd_nobail 'add-apt-repository -y -r ppa:chris-lea/node.js'
  132. exec_cmd "rm -f /etc/apt/sources.list.d/chris-lea-node_js-${DISTRO}.list"
  133. fi
  134.  
  135. print_status 'Adding the NodeSource signing key to your keyring...'
  136.  
  137. if [ -x /usr/bin/curl ]; then
  138. exec_cmd 'curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -'
  139. else
  140. exec_cmd 'wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -'
  141. fi
  142.  
  143. print_status 'Creating apt sources list file for the NodeSource Node.js v6.x repo...'
  144.  
  145. exec_cmd "echo 'deb https://deb.nodesource.com/node_6.x ${DISTRO} main' > /etc/apt/sources.list.d/nodesource.list"
  146. exec_cmd "echo 'deb-src https://deb.nodesource.com/node_6.x ${DISTRO} main' >> /etc/apt/sources.list.d/nodesource.list"
  147.  
  148. print_status 'Running `apt-get update` for you...'
  149.  
  150. exec_cmd 'apt-get update'
  151.  
  152. print_status 'Run `apt-get install nodejs` (as root) to install Node.js v6.x and npm'
  153.  
  154. }
  155.  
  156. ## Defer setup until we have the complete script
  157. setup
  158. ---> d28e36a6e0d8
  159. Removing intermediate container ae42c12b202c
  160. Step 6 : RUN apt-get install -y nodejs
  161. ---> Running in c3a47afa4c08
  162. Reading package lists...
  163. Building dependency tree...
  164. Reading state information...
  165. E: Unable to locate package nodejs
  166. ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get install -y nodejs' returned a non-zero code: 100
  167. signalserver_db_1 is up-to-date
  168. Operations to perform:
  169. Apply all migrations: fileuploads, operations, contenttypes, sessions, auth, admin
  170. Running migrations:
  171. No migrations to apply.
  172. signalserver_redis_1 is up-to-date
  173. signalserver_db_1 is up-to-date
  174. signalserver_rmq_1 is up-to-date
  175. signalserver_web_1 is up-to-date
  176. signalserver_worker_1 is up-to-date
  177. >> Application is running <<
  178. http://192.168.99.100:8000
  179. signalserver_rmq_1 is up-to-date
  180. (djangodev)neko:signalserver yayoi$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement