WebThingsIO / gateway-docker

Legacy docker image for WebThings Gateway - now moved to main gateway repo at https://github.com/WebThingsIO/gateway
Mozilla Public License 2.0
72 stars 25 forks source link

Fails to install node on raspberry pi #3

Closed rchl closed 6 years ago

rchl commented 6 years ago

After #1 was fixed, I'm now getting different error on trying to create docker container on raspberry pi 3. Here is relevant part (it fails on running nvm install --lts):

Step 5/8 : RUN cd /home/user &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.7/install.sh | bash &&     export NVM_DIR="$HOME/.nvm" &&     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" &&     nvm install --lts &&     npm install -g yarn &&     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 &&     yarn
 ---> Running in 6bca6f50655b
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12540  100 12540    0     0  32667      0 --:--:-- --:--:-- --:--:-- 32741
=> Downloading nvm from git to '/home/user/.nvm'
=> Cloning into '/home/user/.nvm'...
Note: checking out '65f0572bdc5c618f747df4b1e70a76fbc0174b82'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

=> Compressing and cleaning up git repository

=> Appending nvm source string to /home/user/.bashrc
=> Appending bash_completion source string to /home/user/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
Installing latest LTS version.
Downloading and installing node v8.10.0...
Downloading https://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-armv7l.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
/usr/bin/env: 'node': No such file or directory
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `nvm use --delete-prefix v8.10.0` to unset it.
The command '/bin/sh -c cd /home/user &&     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.7/install.sh | bash &&     export NVM_DIR="$HOME/.nvm" &&     [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" &&     nvm install --lts &&     npm install -g yarn &&     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 &&     yarn' returned a non-zero code: 11

I have been googling this problem quite a bit and found veeery similar issue filed for other ARM device: https://github.com/creationix/nvm/issues/1354 . Basically it seems to boil down to missing BLX instruction on the ARM architecture but obviously raspberry pi 3 CAN run nodejs (I do it outside of docker), but maybe the docker layer is the problem here.

So not sure that can be fixed but I wonder if you have Pi3 to test with and can confirm same problem.

mrstegeman commented 6 years ago

Every time I try to build on my RPi3, docker just freezes up at Step 3/8. Have you seen that at all?

rchl commented 6 years ago

No, I haven't seen that. Sorry.

mrstegeman commented 6 years ago

Figured out my issue. I will try to get this built and update the Dockerfile tomorrow.

mrstegeman commented 6 years ago

I've got the same issue. I'll look into it.

mrstegeman commented 6 years ago

@rchl This should be working now. I've successfully gotten a container running on my RPi3 and am able to set up my domain, add devices, etc. Let me know if you have additional issues!