update docker commands to avoid privileged mode

This commit is contained in:
Blake Blackshear 2021-02-13 06:52:14 -06:00
parent a661fddaf3
commit 69cab1e6bb

View File

@ -33,19 +33,19 @@ Make sure you choose the right image for your architecture:
It is recommended to run with docker-compose: It is recommended to run with docker-compose:
```yaml ```yaml
version: '3.6' version: '3.9'
services: services:
frigate: frigate:
container_name: frigate container_name: frigate
restart: unless-stopped restart: unless-stopped
privileged: true image: blakeblackshear/frigate:<specify_version_tag>
image: blakeblackshear/frigate:0.8.0-beta2-amd64 devices:
volumes:
- /dev/bus/usb:/dev/bus/usb - /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
- <path_to_config>:/config - <path_to_config_file>:/config/config.yml:ro
- <path_to_directory_for_clips>:/media/frigate/clips - <path_to_directory_for_media>:/media/frigate
- <path_to_directory_for_recordings>:/media/frigate/recordings
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache target: /tmp/cache
tmpfs: tmpfs:
@ -60,19 +60,19 @@ services:
If you can't use docker compose, you can run the container with something similar to this: If you can't use docker compose, you can run the container with something similar to this:
```bash ```bash
docker run --rm \ docker run -d \
--name frigate \ --name frigate \
--privileged \ --restart=unless-stopped \
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \ --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
-v /dev/bus/usb:/dev/bus/usb \ --device /dev/bus/usb:/dev/bus/usb \
-v <path_to_directory_for_clips>:/media/frigate/clips \ --device /dev/dri/renderD128
-v <path_to_directory_for_recordings>:/media/frigate/recordings \ -v <path_to_directory_for_media>:/media/frigate \
-v <path_to_config>:/config:ro \ -v <path_to_config_file>:/config/config.yml:ro \
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='password' \ -e FRIGATE_RTSP_PASSWORD='password' \
-p 5000:5000 \ -p 5000:5000 \
-p 1935:1935 \ -p 1935:1935 \
blakeblackshear/frigate:0.8.0-beta2-amd64 blakeblackshear/frigate:<specify_version_tag>
``` ```
### Calculating shm-size ### Calculating shm-size