Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egil/iot-edge-device-in-docker
A docker image that enables running the aziot-edge in a docker container.
https://github.com/egil/iot-edge-device-in-docker
azure docker iot-edge
Last synced: about 1 month ago
JSON representation
A docker image that enables running the aziot-edge in a docker container.
- Host: GitHub
- URL: https://github.com/egil/iot-edge-device-in-docker
- Owner: egil
- License: mit
- Created: 2024-05-02T09:04:45.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-08T00:15:05.000Z (6 months ago)
- Last Synced: 2024-05-08T17:05:31.421Z (6 months ago)
- Topics: azure, docker, iot-edge
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/egilhansen/iothub-edge-device
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IoT Edge Device in Docker
A docker image that enables running the aziot-edge 1.5 in a docker container.## Getting started
To run an IoT Edge device locally, install a compatible Docker runtime, e.g. Docker for Windows.
Then the following is needed:
1. **Create an IoT device identity:**
```shell
az iot hub device-identity create --device-id --hub-name --edge-enabled
az iot hub device-identity connection-string show --device-id --hub-name
```2. **Start the container:**
```shell
docker run -d --restart unless-stopped --privileged -it -v /var/run/docker.sock:/var/run/docker.sock -v /sys/fs/cgroup:/sys/fs/cgroup:rw -e connectionString='' --hostname=edgedevice1 --name iot-edge-device egilhansen/iothub-edge-device:1.5.7-amd64 --dns 8.8.8.8 --log-driver "json-file" --log-opt "max-file=10" --log-opt "max-size=200k"
```Or use the following docker-compose (with the edge device connection string replaced):
```yml
services:
iot-edge-device:
image: egilhansen/iothub-edge-device:1.5.7-amd64
restart: unless-stopped
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /sys/fs/cgroup:/sys/fs/cgroup:rw
environment:
- connectionString=""
hostname: edgedevice1
dns: 8.8.8.8
logging:
driver: "json-file"
options:
max-file: "10"
max-size: "200k"
```And then run: `docker compose up`.
3. **Monitor IoT edge init:**
```shell
docker exec -it iot-edge-device bash# check init service
journalctl -u iotedge-init.service -f# check iotedge
iotedge list
iotedge check
```