Based off of Professor Kevin Lu's lesson5 on his iot GitHub Repo
First off, I will be making this for Ubuntu 16.04 LTS users, so it will diverge from Professor Lu's GitHub and most likely not work on other operating systems (barring Ubuntu 18.04)
So, to install the latest version of Docker Community Edition, follow the steps below:
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
After running the fingerprint command your output should look like this;
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22 [S]
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
And now, to verify your Docker installation, run the following command. It should give you an informational text output
$ sudo docker run hello-world
If you really want to put your docker to the test, you can run the following command to create a Docker linux box in your terminal!
$ sudo docker run -it ubuntu bash
Lastly, to check which built docker images you have on your machine, you can run the following command.
$ sudo docker images
It will give you the names, tags, Image ID's, creation date, and size of the images
First, we have to clone the crossbario GitHub repository and move into the getting-started folder
$ git clone https://github.com/crossbario/crossbar-examples
$ cd crossbar-examples/getting-started
Next, we have to pull the crossbario Docker image
$ docker pull crossbario/crossbar
And finally, we run the docker image. This will start the crossbar webservice on port 8080
$ sudo docker run -v $PWD:/node -u 0 --rm --name=crossbar -it -p 8080:8080 crossbario/crossbar
Now on another terminal we must run the crossbar publish client. We will need to install autobahn and then run a script within the crossbar examples folder
$ pip install autobahn
$ cd crossbar-examples/getting-started/1.hello-world/
$ python3 client_component_publish.py
And lastly run the subscriber in another terminal
$ cd crossbar-examples/getting-started/1.hello-world/
$ python3 client_component_subscriber.py
Up first, we have to install mosquito and paho, and start up the mosquito sub
$ sudo apt install mosquitto mosquitto-clients
$ mosquitto_sub -h localhost -v -t "\$SYS/#"
Time to publish a message on another terminal
$ mosquitto_pub -h localhost -t test/topic -m "Message"
And now time to install paho
$ pip install paho-mqtt
$ git clone git@github.com:kevinwlu/iot.git
$ cd iot/lesson5/
$ python3 client.py
Now run each of these commands in a separate terminal in order to set up the pub-sub system.
$ python3 sub.py
$ python3 pub.py
You can also use the scripts pub-multiple and sub-multiple in place of pub and sub, as seen below