3

I'm trying to expand my use of docker for my local environment (and learn more about docker in the process). But I have a question about getting notifications from gulp-notify back to my desktop. They show up in my terminal logs just fine.

My docker-compose file contains a local section like this.

local:
  image: uconn/local:latest
  ports: 
    - "3000:3000"
volumes:
    - ./:/project
    - /project/node_modules
tty: true

Typically in my gulpfile I use a task like this

gulp.task('sass', function() {
  return gulp.src('./style.scss')
      .pipe(plugins.plumber({
          errorHandler: plugins.notify.onError("Error <%= error.message %>")
      }))
      .pipe(plugins.sass())
      .pipe(gulp.dest('./', {
          overwrite: true
      }));
}); 

The task itself works (it turns sass into css) but on error's the notifier reports gulp-notify: [Error running notifier] Could not send message: not found: notify-send.

Since I'm running the gulp task inside docker, I suppose it's obvious that this won't work the way it is. So, how can I pass the notification messages out of docker?

EDIT/UPDATE I just found this info in the docker docs. However I don't have enough experience to understand what it means.

I WANT TO CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST

The Mac has a changing IP address (or none if you have no network access).
From 17.06 onwards our recommendation is to connect to the special Mac-only
DNS name docker.for.mac.localhost which will resolve to the internal IP
address used by the host.
Erazihel
  • 7,295
  • 6
  • 30
  • 53
aberkow
  • 330
  • 1
  • 10
  • First you need to install libnotify-bin in your container to have the `notify-send` executable. But it's not enough you need to share the X11 socket and may be the dbus socket too. My tests didn't give me good results, so I pinged Jessie Frazel on twitter. She is an expert on desktop application in docker – D. Gonçalves Jul 21 '17 at 21:21
  • Thanks! I'm just seeing this now. Didn't get a notification for some reason. I'm still very new at docker, networking, etc... – aberkow Jul 24 '17 at 12:17

0 Answers0