Open dakshshah96 opened 6 years ago
Alpine relies on musl libc and will not work with WiFi Connect. Also it does not have apt-get. You can use a Docker image based on Debian instead. We provide base images which target Node.js development. What type of device specifically you are using - is it a raspberry pi 3?
@majorz Yes, I'm using a Raspberry Pi 3 Model B. Is the resin/raspberrypi3-node
base image fine?
EDIT: Yes, that image seems to not have a problem with apt-get. However, I get a different error now in the RUN curl ...
part while pushing to resin:
[main] Step 5/9 : RUN curl https://api.github.com/repos/resin-io/resin-wifi-connect/releases/latest -s | grep -hoP 'browser_download_url": "\K.*%%RESIN_ARCH%%\.tar\.gz' | xargs -n1 curl -Ls | tar -xvz -C /usr/src/app/
[main] ---> Running in 30f7bd5cf79d
[main] curl: no URL specified!
[main] curl: try 'curl --help' or 'curl --manual' for more information
[main]
[main]
[main] gzip: stdin: unexpected end of file
[main]
[main] tar: Child returned status 1
[main] tar: Error is not recoverable: exiting now
[main]
[main] Removing intermediate container 30f7bd5cf79d
[main] The command '/bin/sh -c curl https://api.github.com/repos/resin-io/resin-wifi-connect/releases/latest -s | grep -hoP 'browser_download_url": "\K.*%%RESIN_ARCH%%\.tar\.gz' | xargs -n1 curl -Ls | tar -xvz -C /usr/src/app/' returned a non-zero code: 2
My Dockerfile looks like this:
# base image: for RaspberryPi
FROM resin/raspberrypi3-node
# enable systemd init system
ENV INITSYSTEM on
# set working directory
WORKDIR /usr/src/app
# -- start of resin-wifi-connect section -- #
# use apt-get to install dependencies
RUN apt-get update \
&& apt-get install -y dnsmasq wireless-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install resin-wifi-connect
RUN curl https://api.github.com/repos/resin-io/resin-wifi-connect/releases/latest -s \
| grep -hoP 'browser_download_url": "\K.*%%RESIN_ARCH%%\.tar\.gz' \
| xargs -n1 curl -Ls \
| tar -xvz -C /usr/src/app/
# -- end of resin-wifi-connect section -- #
# -- start of node.js application section -- #
COPY package*.json ./
RUN npm install
COPY . .
# -- end of node.js application section -- #
# run start script
CMD ["bash", "start.sh"]
I am away now and could not try running that, but you may go to the releases page, get the link to the armv7hf archive and do ´curl -OL https://...tar.gz´ to download and then ´tar zxf ...tar.gz´ to extract it. I can check it out tomorrow if you cannot resolve it.
@majorz I did that on my Terminal. curl
downloads the tar.gz file properly and I was able to extract the contents as well with tar zxf ...
without any errors.
@dakshshah96 we run our node app in a separate container and it works great. There's no need to map any network connectivity between the containers.
@dakshshah96 I will close this now, but please reopen it or open a new issue in case you encounter difficulties or problems.
@majorz Still facing the same problem 😞
I will try to find time to look at it tomorrow.
same problem here
I love working with Resin.io but can't figure out how to integrate
resin-wifi-connect
in my existing Node.js application.Currently, my Dockerfile looks like this:
It'd be great if someone can help me figure out how to run
resin-wifi-connect
before my Node.js application starts. cc @majorzWould something like this work?
Dockerfile
start.sh
I don't know how to start my Node.js from the script file.