It just installs the NetworkManager on a container.
If I execute nmcli -s -g 802-11-wireless-security.psk connection show <My SSID> command on container, it returns nothing. But this command works on hostOS.
I have tested on the latest development image of RPi Zero W.
Could you guys check my repository and let me know what is wrong?
It just contains a couple of files.
Hello Wester,
There weren’t any other flaws in the configuration that we could see in your setup. Hence, I went the extra mile and reproduced the command on RPi0 W. Indeed, the command works on HostOS and not the container. We concluded that this could be a security feature where containers aren’t able to access security keys of the hostOS. We ran other commands which worked out fine such as nmcli connection show <SSID> which provided all the information except the credentials were hidden.
We are also observed a version mismatch between nmcli version of HostOS and the container. Hence, we created a new release with debian version as bullseye in the hopes to see some change and it worked. In your dockerfile.template, please replace the base image with and push a new release FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node:latest-bullseye-build
That should do it.
Unfortunately we cannot upgrade the base image for Buster because it uses the official Debian repositories, which define what versions packages are pinned to. We can only upgrade the packages installed on the host OS.
There are a few of other options though:
You may build in the Dockerfile for that container NetworkManager. You may do that on top of your Dockerfile, so that cache is used when you modify later lines there. For making the images smaller in this case you may use multistage bukds - https://www.balena.io/docs/reference/base-images/base-images/.
Probably a better option I would personally prefer is to not use nmcli at all, but retrieve the information through a NetworkManager client library. That will take extra time to develop though. You may check examples in different languages here: https://github.com/NetworkManager/NetworkManager/tree/master/examples
Or you may omit from your application getting the password. I guess it is for editing purposes, so you may just make the users enter it from scratch.