Hi @vipulgupta2048
Thanks for your help. I think your summary about my work is correct. Here is my answer about your question.
I am not sure what you mean by Wifi-connect installed on the host device outside the docker container.
I meant that I installed wifi-connect not only in Django docker container but also outside the container, i.e. on the hostOS(raspbian). If wifi-connect is not installed on the hostOS, I get such an error(NetworkManager service failed) when I run the container using Zane’s command.
If wifi-connnect is installed on the hostOS, then wifi-connect works when I run the container.
Does it make sense?
I think I need to share my whole Dockerfile for Django container.
FROM python:3.7.3
ENV PYTHONUNBUFFERED=0
ENV INITSYSTEM on
RUN apt-get -y update && apt-get -y upgrade
RUN pip3 install --upgrade pip
RUN apt-get -y install libopenblas-dev
RUN pip3 install pybind11
RUN apt install python3-netifaces
WORKDIR /app
ADD requirements.txt /app/
RUN pip3 install -r requirements.txt
COPY . /app
RUN apt-get install -y supervisor
RUN service supervisor restart
ADD uart.conf /etc/supervisor/conf.d
# Install balena wifi-connect
RUN apt-get update && apt-get install -yq --no-install-recommends \
dnsmasq && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN curl https://api.github.com/repos/balena-io/wifi-connect/releases/latest -s \
| grep -hoP 'browser_download_url": "\K.*armv7hf\.tar\.gz' \
| xargs -n1 curl -Ls \
| tar -xvz -C /app/
RUN chmod 774 docker-entrypoint.sh
ENTRYPOINT ["bash", "docker-entrypoint.sh"]
I have already built a Django container with this Dockerfile using docker build command and ran the container using Zane’s command. Then I accessed the container and executed wifi-connect by running a bash file I made. Wifi-connect worked properly inside the container.
Next I needed to run the Django container and other containers using docker-compose. So I ran all containers using the docker-compose.yml I have already shared with Zane. I think you already checked it. You can see it in above screenshot.
The problem is from now on.
When I accessed the Django container, I can’t see wifi-connect installed. Therefore, when I run the bash file(I mentioned in above) in the container, it causes the following error.
wifi-connect.sh: line 5: ./wifi-connect: No such file or directory
The Dockerfile for django service in docker-compose.yml file is the same as Dockerfile that I have already tested using Zane’s command. They’re exactly the same. And I definitely saw wifi-connect being installed while building the image using docker-compose.yml file.
Please check the below screenshot.
In the above screenshot, wifi-connect.sh is my custom bash file to execute wifi-connect.
In other words, I couldn’t see wifi-connect installed in Django container when using docker-compose.
Again, the same Dockerfile was used for both cases.
I think there is any problem in docker-compose.yml file. I don’t think the options used in Zane’s docker run command were exactly applied to docker-compose.yml file. I made several changes on docker-compose.yml file, they didn’t work. I also tried docker-compose.yml with “2”, “2.1” and “3” of Dockerfile version. Unfortunately, they also didn’t work.
How can I solve this?
Sorry for my long explanation, but I tried to explain my situation clearly.
Looking forward to your solution.
Thanks.
Anatoli