This guide describes two different ways to install the device local proxy on your device. Either via the Portainer web interface or via the command line.
The following requirements must be fulfilled in order to install the client on your device:
- Docker engine installed on edge-device
- Internet access on edge-device
- Device provisioned via web page
Login Data for Container Registry
The login data for the container registry is managed by your admin.
Please contact them to get the correct server url (referred as <Registry Login Server>), username (referred as <Registry Username>) and password (referred as <Registry Password>).
Installation using command line
1. Connect to the device using ssh.
$ ssh <user>@<ip-of-device>
2. Login with docker to your container registry. Use the copied <Registry Username> and <Registry Password>.
$ docker login <Registry Login Server>
3. Pull the container image from the public container registry.<br>
$ docker pull <Registry Login Server>/modules/devicelocalproxy
4. Run the newly pulled image. To associate the device with Cloud Remote Access you need to provide the previously copied connection string as an environment variable.
- To run the container a single time without a restart use the following command.
$ docker run -e IOTHUB_DEVICE_CONN_STRING='<Copied Connection String>' <Registry Login Server>/modules/devicelocalproxy
- To automatically restart the client after a reboot of the system add the "--restart always" parameter.
$ docker run -e IOTHUB_DEVICE_CONN_STRING='<Copied Connection String>' --restart always <Registry Login Server>/modules/devicelocalproxy
Installation using Portainer
1. Open the Portainer web page and login.
2. Go to the correct endpoint (in this example "local").
3. Navigate to the Registries page on the left-handed navigation bar.
4. Click "Add registry".
5. Select "Custom registry" and fill out name (M&M-CloudRemoteShell), registry url (<Registry Login Server>), user (<Registry Username>) and password (<Registry Password>).
6. Click "Add registry".
7. Navigate to containers on the left-handed navigation bar.
8. Click "Add container".
9. Fill out name (DeviceLocalProxy), select the newly added registry and fill out image (modules/devicelocalproxy).
10. In the advanced container settings open the "Env" tab and add the previously copied Connection string as an environment variable (name: IOTHUB_DEVICE_CONN_STRING, value: <Copied Connection string>).
11. Click "Deploy the container".
12. Start the container by selecting it and clicking "Start".