This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tuwiendsg/pull-request-docker-example
sensor docker example pull request
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from leduchung/ubuntu:14.04-jre8 | ||
|
||
RUN mkdir -p /tmp/sensor | ||
|
||
ADD cloud-connectivity-0.0.1-SNAPSHOT-jar-with-dependencies.jar /tmp/sensor/cloud-connectivity-0.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
ADD sdcommon-0.0.1-SNAPSHOT.jar /tmp/sensor/sdcommon-0.0.1-SNAPSHOT.jar | ||
ADD sdsensor-0.0.1-SNAPSHOT-jar-with-dependencies.jar /tmp/sensor/sdsensor-0.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
|
||
ADD data.csv /tmp/sensor/data.csv | ||
ADD mqttcloud.json /tmp/sensor/mqttcloud.json | ||
ADD runsensor.sh /tmp/sensor/runsensor.sh | ||
|
||
WORKDIR /tmp/sensor | ||
|
||
CMD ["/bin/sh", "./runsensor.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Run software-define sensor in docker | ||
|
||
To use the Dockerfile, following steps need to be done: | ||
|
||
1. Build the sensor source code. | ||
2. Copy the following files into the same folder with the Dockerfile: | ||
1. src/sdsensor/target/sdsensor-0.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
2. src/sdcommon/target/sdcommon-0.0.1-SNAPSHOT.jar | ||
3. src/sdcloudconnectivity/target/cloud-connectivity-0.0.1-SNAPSHOT-jar-with-dependencies.jar | ||
4. src/sdsensor/conf/mqttcloud.json (must be edited to match with your MQTT broker) | ||
5. src/sdsensor/datasample/data.csv (optional: replace with your data file) | ||
3. Run following command: | ||
``` | ||
docker build -t yourImageName . | ||
docker run yourImageName | ||
``` | ||
4. You can view the data being pushed to the MQTT broker with settings as in mqttcloud.json | ||
|
||
Note: The Dockerfile use an Ubuntu image with Java by default to run. If you want to use other images, please make sure java is available. |