This folder contains docker-compose.yml for EdgeX Foundry Fuji release (1.1.0) in home lab.
Originally docker-compose-fuji-no-secty.yml
from edgexfoundry/developer-scripts
.
- Ubuntu 19.10
The procedure described in official guide does not work correctly.
Please note that official docker-ce packages for 19.10 (eoan
) does NOT RELEASED YET.
Currently we have to use packages for 19.04 (disco
).
$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"
$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io
$ sudo usermod -aG docker ${USER}
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ docker-compose pull
$ docker-compose up -d
$ docker-compose ps
Please note device-mqtt-go
has exited because configuration file for this device service includes incorrect values for your future setup.
If you want to make this work correctly, follow (Setup with MQTT Device Service)[#setup-with-mqtt-device-service] section.
$ docker-compose stop
Or, if you want to remove containers, try this:
$ docker-compose down
To remove all docker images related to EdgeX Foundry, run following command.
This command does not remove volumes.
$ docker-compose down --rmi all
To remove volumes, run sudo docker volume ls
and sudo docker volume rm <volume_name>
.
If you want to remove all unused volumes (including used outside of EdgeX Foundry), you can use this:
$ docker volume prune
This repository includes files to try walkthrough MQTT Example and Tutorial in official document.
MQTT device service has already included in docker-compose.yml
, but not work correctly by default.
If you make this work, you have to do followings.
You can run MQTT broker using container.
$ docker run -d --rm --name broker -p 1883:1883 eclipse-mosquitto
This example device will work with MQTT topics called DataTopic
, CommandTopic
, and ResponseTopic
.
You can simulate this device by using mqtt-scripts by following command. You should replace <your-broker-ipaddress>
with your broker IP address.
$ cd mqtt-scripts
$ docker run -d --restart=always --name=mqtt-scripts -v $PWD:/scripts dersimn/mqtt-scripts --url mqtt://<your-broker-ipaddress> --dir /scripts
Now you have MQTT broker and publisher. You can see the values sent from this simulator every 15 seconds by subscribing DataTopic
.
$ mosquitto_sub -h <your-broker-ipaddress> -t DataTopic
{"name":"MQ_DEVICE","cmd":"randnum","randnum":"26.1"}
{"name":"MQ_DEVICE","cmd":"randnum","randnum":"27.9"}
{"name":"MQ_DEVICE","cmd":"randnum","randnum":"25.0"}
...
Finally modify mqtt/configuration.toml
file to make Device Service subscribe broker correctly.
Replace <your-broker-ipaddress>
in this file with your broker IP address.
Now you can start EdgeX Foundry.
$ docker-compose down
$ docker-compose up -d
$ docker-compose ps
See official tutorial or Web GUI (http://<your-ipaddress>:8080/
) to check if it works correctly.