ローカル環境で docker の使用を拡大しようとしています (その過程で docker について詳しく学びます)。しかし、gulp-notify からの通知をデスクトップに戻すことについて質問があります。それらは私の端末ログに問題なく表示されます。
私の docker-compose ファイルには、local
このようなセクションが含まれています。
local:
image: uconn/local:latest
ports:
- "3000:3000"
volumes:
- ./:/project
- /project/node_modules
tty: true
通常、私のgulpfileでは、このようなタスクを使用します
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
}));
});
タスク自体は機能します (sass を css に変換します) が、エラーが発生した場合は通知機能が報告しgulp-notify: [Error running notifier] Could not send message: not found: notify-send
ます。
docker 内で gulp タスクを実行しているので、このままでは機能しないことは明らかだと思います。では、docker から通知メッセージを渡すにはどうすればよいでしょうか?
編集/更新ドッカーのドキュメントでこの情報を見つけました。しかし、私はそれが何を意味するのかを理解するのに十分な経験がありません。
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.