|
| 1 | +# Docker Installation and Usage |
| 2 | + |
| 3 | +This is the preferred method of deploying and operating the Deadeye system. |
| 4 | +Docker is readily available on most, if not all, Linux distributions used on |
| 5 | +vision coproccessors. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +We'll use the [Docker Compose](https://docs.docker.com/compose/) tool to deploy |
| 10 | +and operate Deadeye. The example commands below work on an Orange Pi running |
| 11 | +their Ubuntu based [Orange Pi OS |
| 12 | +(OH)](http://www.orangepi.org/html/softWare/orangePiOS/oh.html). |
| 13 | + |
| 14 | +```sh |
| 15 | +sudo apt update |
| 16 | +sudo apt install docker-compose-plugin |
| 17 | +``` |
| 18 | + |
| 19 | +### Docker Compose |
| 20 | + |
| 21 | +Edit the `docker-compose.yaml` file as appropriate for your system. Select the |
| 22 | +[docker image tags](https://hub.docker.com/search?q=j3ff/deadeye) to use and |
| 23 | +edit the lines containing: |
| 24 | + |
| 25 | +```yaml |
| 26 | +daemon: |
| 27 | + image: j3ff/deadeye-daemon:<TAG> |
| 28 | +admin: |
| 29 | + image: j3ff/deadeye-admin:<TAG> |
| 30 | +web: |
| 31 | + image: j3ff/deadeye-web:<TAG> |
| 32 | +``` |
| 33 | +
|
| 34 | +There are a number of environment variables beginning with `DEADEYE_` that you |
| 35 | +may need to edit. |
| 36 | + |
| 37 | +### systemd |
| 38 | + |
| 39 | +The Deadeye containers are run using systemd instead of normal container restart |
| 40 | +policies to work around Docker issues with camera device names. |
| 41 | + |
| 42 | +Edit and install the `deadeye.service` systemd service definition as appropriate |
| 43 | +for your system, for example: |
| 44 | + |
| 45 | +``` |
| 46 | +Environment="DOCKER_COMPOSE_FILE=/home/orangepi/deadeye/docker-compose.yml" |
| 47 | +Environment="CAMERA_PATH=/dev/v4l/by-id/usb-Microsoft_Microsoft®_LifeCam_HD-3000-video-index0" |
| 48 | +``` |
| 49 | + |
| 50 | +Install in `/etc/systemd/system/deadeye.service` and reload systemd services: |
| 51 | + |
| 52 | +```sh |
| 53 | +systemctl daemon-reload |
| 54 | +``` |
| 55 | + |
| 56 | +## Operation |
| 57 | + |
| 58 | +Start the Deadeye containers with: |
| 59 | + |
| 60 | +```sh |
| 61 | +sudo systemctl start deadeye |
| 62 | +``` |
| 63 | + |
| 64 | +Stop the Deadeye containers with: |
| 65 | + |
| 66 | +```sh |
| 67 | +sudo systemctl stop deadeye |
| 68 | +``` |
| 69 | + |
| 70 | +View container logs: |
| 71 | + |
| 72 | +```sh |
| 73 | +# in directory containing docker-compose.yaml |
| 74 | +docker compose logs -f |
| 75 | +
|
| 76 | +# or alternatively, where SERVICE is one of: admin, daemon, web |
| 77 | +docker compose logs $SERVICE |
| 78 | +``` |
| 79 | + |
| 80 | +Updating the containers to a new version: |
| 81 | + |
| 82 | +```sh |
| 83 | +sudo systemctl stop deadeye |
| 84 | +
|
| 85 | +# in directory containing docker-compose.yaml |
| 86 | +# edit the docker image tag(s) in docker-compose.yaml |
| 87 | +docker compose pull |
| 88 | +
|
| 89 | +# it's a good idea to recreate the docker network |
| 90 | +docker compose down |
| 91 | +
|
| 92 | +sudo systemctl start deadeye |
| 93 | +``` |
| 94 | + |
| 95 | +Clean up old docker images and containers. |
| 96 | + |
| 97 | +```sh |
| 98 | +docker system prune |
| 99 | +``` |
0 commit comments