Copyright 2015 Stefano Terna
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
The iottly-docker repo defines and maintains the Iottly stack architecture and makes it easy to run the full environment in both production and development.
Iottly runs on Linux / Docker.
- install Docker (> 1.10.2): http://docs.docker.com/engine/installation/
- install Docker Compose (> 1.6.0): https://docs.docker.com/compose/install/
mkdir iottly
cd iottly
- clone each Iottly repo
- eventually with this script
- see after a fresh clone in iottly-console repo.
cd iottly-docker
./start_iottly_locally.sh
- this will:
- set the env var
HOST_IP_ADDRESS
with the IP address of your dev box- the address is the one with which your box is connected to the local network (via eth or wlan)
- this allows testing the dev env of Iottly with physical devices connected to your local network
- if you are running Docker on non Linux OS maybe you need to set a bridge networking on the underlying VBox machine
- pull required images from Docker Hub
- build each Iottly component as per specific Dockerfile in each repo
- start each component
- set the env var
Containers communicate via 'iottlydocker' (local) network created by Docker Compose.
All services are exposed via iottly-http-load-balancer:
- iottly web application (iottly-console):
- iottly-core API:
- iottly-core web socket:
- iottly-xmpp-broker:
- iottly-client-core and iottly-client-UI:
Iottly makes use of Docker Compose override feature to combine the following needs:
- production needs: source files have to be shipped within the container
- development needs: source files have to be shared among container and host
For this purpose production services are defined in the main docker-compose.yml
file, while development overrides are defined in the docker-compose.override.yml
. Specifically the override file defines how the development host directories overlay the container directories. In this way a change in a source file is immediately available to the container after saving it.
cd iottly-docker
(all docker compose commands should be run from within iottly-docker
dir)
- to get the list of running of running services:
docker-compose ps
- to get logs of a running service (for example for iottlycore):
docker-compose logs iottlycore
- to execute a shell within a running container (for example for iottlycore):
docker exec -i -t iottlydocker_iottlycore_1 bash
- note that you need to use the container name here, not the service name
- to inspect the /etc/hosts file in a running container (for example for xmppbroker):
docker exec -i -t iottlydocker_xmppbroker_1 cat /etc/hosts