Docker image based on Debian Stretch for running the Mozilla WebThings Gateway.
While the gateway doesn't necessarily require full local network access, some add-ons may. Therefore, it is best to run with the --net=host
flag. Currently, this flag will not work when using Docker for Mac or Docker for Windows due to this and this.
-
On Linux:
docker run \ -d \ --rm \ -v /path/to/shared/data:/home/node/.mozilla-iot \ --net=host \ --name mozilla-iot-gateway \ mozillaiot/gateway:latest
-
On Windows or macOS:
docker run \ -d \ --rm \ -p 8080:8080 \ -p 4443:4443 \ -v /path/to/shared/data:/home/node/.mozilla-iot \ --name mozilla-iot-gateway \ mozillaiot/gateway:latest
Tested on Raspberry Pi 3 Model B/B+:
docker run \
-d \
--rm \
-v /path/to/shared/data:/home/node/.mozilla-iot \
--net=host \
--name mozilla-iot-gateway \
mozillaiot/gateway:arm
-d
- Run in daemon mode (in the background)--rm
- Remove the container after it stops-v /path/to/shared/data:/home/node/.mozilla-iot
- Change/path/to/shared/data
to some local path. It will be used to store the "user profile", i.e. add-ons, logs, configuration data, etc.--net=host
- Shares host networking with containeri (highly recommended)-p 8080:8080
/-p 4443:4443
- Forward necessary ports to the container--name mozilla-iot-gateway
- Name of the container
After running the container, you can connect to it at: http://<host-ip-address>:8080
If you'd like to build an image yourself, run the following:
git clone https://github.com/mozilla-iot/gateway-docker
cd gateway-docker
docker build -t gateway .
docker run \
-d \
--rm \
-v /path/to/shared/data:/home/node/.mozilla-iot \
--net=host \
--name mozilla-iot-gateway \
gateway