From 2384de73b57f85004910ddff94b793e485c52453 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Fri, 10 Aug 2018 16:26:00 +0200 Subject: [PATCH] Fix yarn failure to install (package.json lookup) yarn failed to install and thus failed to install gateway dependencies, to we relocate it to let it find gateway's package.json file. Observed (silent) issue on docker 17.12.1-ce (Ubuntu-18.04) on x86_64: npm WARN saveError ENOENT: no such file or directory, open '/home/node/package.json' (...) + yarn@1.9.4 added 1 package in 0.447s Cloning into 'intent-parser'... Cloning into 'gateway'... yarn install v1.9.4 [1/4] Resolving packages... [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.4: The platform "linux" is incompatible with this module. (...) [3/4] Linking dependencies... [4/4] Building fresh packages... Change-Id: I8737dfc28da8c8bf266de829725f3c09f62d9468 Signed-off-by: Philippe Coval --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e85be1..bb75376 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,14 +33,15 @@ RUN echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/s echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER node -RUN cd /home/node && \ - npm install yarn && \ +WORKDIR /home/node +RUN set -x && \ mkdir mozilla-iot && \ cd mozilla-iot && \ git clone https://github.com/mozilla-iot/intent-parser && \ git clone https://github.com/mozilla-iot/gateway && \ cd gateway && \ - /home/node/node_modules/.bin/yarn + npm install yarn && \ + yarn USER root ADD service /etc/service