This is the solution for the challenge in step 2.
- Run
docker ps -q | xargs docker stopto stop all running containers - Change directory to
services/serializer - Run
docker build -t serializer . - Run influxdb
docker run -d -p 8083:8083 -p 8086:8086 --expose 8090 --expose 8099 tutum/influxdb - Run
sh ./runContainer.sh - Run the curl command below, it will return null, run it a couple of times to add some dummy data
- Open the influxdb console with
docker exec -ti <containerID> /opt/influxdb/influx - Execute
use temperature; select * from temperature;in the influx console to see the data
Data add curl:
curl -X POST -d "{\"role\": \"serialize\", \"cmd\": \"write\", \"sensorId\": \"1\", \"temperature\": 32}"
http://`docker-machine ip default`:3001/act --header "Content-Type:application/json"
Running multiple containers individually is error prone, your challenge is to use docker-compose. In this step you will create a docker compose yml file to launch all our containers with a single command.
A skeleton docker-compose.yml is provided for you, you just need to
fill in the settings for the various containers.
Hint: You can see a completed docker-compose.yaml here
