Skip to content

Commit

Permalink
bring back node, workaround for eth0 detection
Browse files Browse the repository at this point in the history
eth0 detection bug: nodejs/node-v0.x-archive#9029
  • Loading branch information
IxDay committed Mar 30, 2015
1 parent d47712a commit b6dde34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ADD gulpfile.js $WORKDIR

RUN apt-get update
RUN apt-get install -y curl unzip
RUN curl -sL https://deb.nodesource.com/setup_iojs_1.x | bash -
RUN apt-get install -y iojs
RUN curl -sL https://deb.nodesource.com/setup_0.12 | bash -
RUN apt-get install -y nodejs

RUN npm install gulp gulp-connect

Expand Down
10 changes: 9 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
var gulp = require('gulp');
var connect = require('gulp-connect');
var exec = require('child_process').execSync;

var os = require('os');

var mounted_dir = '/mnt';
var mounted_dir_files = mounted_dir + '/**';

// workaround for https://github.com/joyent/node/issues/9029
var ip_command = 'ip addr show eth0 | ' +
'awk \'$2 ~/172\.17/ { gsub(/\\/.*/, "", $2); print $2 }\'';
var ip_address = exec(ip_command);

console.log(ip_address);

var ifaces = os.networkInterfaces();
console.log(ifaces);
var ip_address = ifaces['eth0'][0].address

gulp.task('init', function () {
Expand Down

0 comments on commit b6dde34

Please sign in to comment.