This repository provides Docker images regularly built from the official Shinobi Pro repository and additional microservices images, some with hardware acceleration support for NVIDIA or Intel GPUs.
Thank you mrproper, pschmitt & moeiscool for the continuation of the development for the official Docker image.
Find my images on Docker Hub migoller/shinobi and the git repository for upcoming images at https://gitlab.com/MiGoller/ShinobiDocker .
This README.md has grown in size. Looks like I'll have to write it down into a Wiki.
Starting with Docker images enhancing the "official" ShinobiDocker image I provide additional microservices images, some with hardware acceleration support for NVIDIA or Intel GPUs.
Run Shinobi using the "microservice" Shinobi Docker images microservice-ffmpeg, microservice-vaapi,microservice-alpine and microservice-nvidia as a stack, connect the Shinobi container to an already existing MariaDB server or run a standalone Shinobi instance with a SQLite database.
You can run a small setups with "microservice" Shinobi Docker images almost out of the box.
microservice-alpine, 0.x.x-microservice-alpine Shinobi Pro built on Alpine Linux and Alpine FFmpeg microservice-alpine/Dockerfilemicroservice-ffmpeg, 0.x.x-microservice-ffmpeg Shinobi Pro built on Ubuntu and FFmpeg microservice-ffmpeg/Dockerfilemicroservice-vaapi, 0.x.x-microservice-vaapi Shinobi Pro built on Ubuntu and FFmpeg and Intel VAAPI support microservice-vaapi/Dockerfilemicroservice-nvidia, 0.x.x-microservice-nvidia Shinobi Pro built on Ubuntu and NVIDIA support with preinstalled YOLOv3 plugin. microservice-nvidia/DockerfileThe all-in-one images provide the same features as the corresponding microservice images, but they come with a built-in MariDB server. So if you're looking for a single container solution just give it a try.
alpine, 0.x.x-alpine Shinobi Pro built on Alpine Linux and Alpine FFmpeg alpine/Dockerfileffmpeg, 0.x.x-ffmpeg Shinobi Pro built on Ubuntu and FFmpeg ffmpeg/Dockerfilevaapi, 0.x.x-vaapi Shinobi Pro built on Ubuntu and FFmpeg and Intel VAAPI support vaapi/Dockerfilenvidia, 0.x.x-nvidia Shinobi Pro built on Ubuntu and NVIDIA support with preinstalled YOLOv3 plugin. nvidia/DockerfileDue to the amount of image variants I decided to stop developing and adding new features to the following images and tags. Right now these images will be part of the continuous builds until end of 2020.
And there are more issues and recommendations:
Warning: I recommend to switch to a supported image variant or tag as soon as possible.
2.0.0-official, 2.0-official, 2-official, official, latest master/official/Dockerfile2.0.0-alpine, 2.0-alpine, 2-alpine, alpine master/alpine/Dockerfile2.0.0-debian, 2.0-debian, 2-debian, debian master/debian/DockerfileBreaking changes:
- The tags
latestandofficialrefer toalpine.- The tag
debianrefer toffmpeg.
2.0.0-microservice, 2.0-microservice, 2-microservice microservice/alpine/Dockerfile2.0.0-microservice-debian, 2.0-microservice-debian, 12-microservice-debian microservice/debian/DockerfileWarning: Currently Alpine-based Docker images Shinobi may encounter DNS-resolution issues to hostnames and FQDN with static FFmpeg builds.. If you encounter such a problem just give the
microservice-alpineormicroservice-ffmpegimages a try.
Breaking changes:
- The tag
microservicerefers tomicroservice-alpine.- The tags
microservice-debianandmicroservice-archrefer tomicroservice-ffmpeg.
If you are looking for how to dock the deprecated images and tags, have a look at the Shinobi for Docker image variants, please.
Now you have at least two additional options to dock Shinobi.
I assume that you followed the guide eg. Get Docker CE for Ubuntu to install Docker CE. If you do not Manage Docker as a non-root user you'll have to
sudothe Docker commands. Thedocker cliis used when managing individual containers on a docker engine. It is the client command line to access the docker daemon api.
These are some basic steps to get an container up and running and to persists the containers data.
.service-files, docker-compose files, etc. as well.The container should be stateless.
Well, it depends. ;-)
alpine images come without any hardware acceleration support but a small storage foot print.ffmpeg images are the recommended Ubuntu based images without any hardware acceleration support.vaapi images come with hardware acceleration support for Intel VA-API GPUs including integrated graphics on CPUs like Intel Pentium G4xxx .nvidia image come with hardware acceleration support for NVIDIA GPUs providing CUDA and CUVID codecs and features. That's why the YOLOv3 plugin is available out of the box, too.Notice: Ensure you have installed the proper drivers on your Docker host. VA-API or CUDA will not work without a working Docker host setup.
microservice-alpine, microservice-ffmpeg, microservice-vaapi and microservice-nvidiaRun Shinobi using the "microservice" Shinobi Docker images microservice-alpine, microservice-ffmpeg, microservice-vaapi and microservice-nvidia as a stack, connect the Shinobi container to an already existing MariaDB server or run a standalone Shinobi instance with a SQLite database.
The all-in-one images provide the same features as the corresponding microservice images, but they come with a built-in MariDB server. You can run in it out of the box, but don't forget to mount a local folder or a volume to /var/lib/mysql inside of the containter. Otherwise your data will get lost when the container will be removed.
First create directories for Shinobi's database, video and configuration files.
$ mkdir -p [Path to Shinobi direcory]/config [Path to Shinobi direcory]/datadir [Path to Shinobi direcory]/videos
Create a docker-compose.yml file in the directory [Path to Shinobi direcory] with the following content.
version: '2'
services:
app:
image: migoller/shinobidocker:nvidia
env_file:
- Shinobi.env
environment:
- "TZ=Europe/Berlin"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./config:/config
- ./videos:/opt/shinobi/videos
- ./datadir:/var/lib/mysql:rw
- /dev/shm/shinobiDockerTemp:/dev/shm/streams
ports:
- "8080:8080"
Create .env-files to set the environment variables.
Use .env-files to set the environment variables only ones but use them in many containers. We need environment variables to configure Shinobi and MariaDB at runtime, because the container is stateless.
Create MySQL.env with the following content.
MYSQL_USER=majesticflame
MYSQL_PASSWORD=password
MYSQL_ROOT_PASSWORD=blubsblawoot
MYSQL_ROOT_USER=root
EMBEDDEDDB=false
Notice: Ensure you set
EMBEDDEDDB=false. Otherwise your setup will use a local SQLite database.
Create Shinobi.env with the following content.
[email protected]
ADMIN_PASSWORD=admin
CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f
PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57
PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d
PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi
MOTION_HOST=localhost
MOTION_PORT=8080
PASSWORD_HASH=sha256
PRODUCT_TYPE=Pro
To start the Shinobi stack just type:
$ docker-compose up -d
If you want to stop the stack run docker-compose down.
The stack should be up and running.
Well, that's quite easy. A Shinobi stack creates two containers: A container for Shinobi and a second container for Shinobi's private MariaDB server.
First create directories for Shinobi's database, video and configuration files.
$ mkdir -p [Path to Shinobi direcory]/config [Path to Shinobi direcory]/datadir [Path to Shinobi direcory]/videos
Create a docker-compose.yml file in the directory [Path to Shinobi direcory] with the following content.
version: '2'
services:
db:
image: mariadb
env_file:
- MySQL.env
volumes:
- ./datadir:/var/lib/mysql
app:
# image: migoller/shinobidocker:microservice-alpine
image: migoller/shinobidocker:microservice-ffmpeg
# image: migoller/shinobidocker:microservice-vaapi
# image: migoller/shinobidocker:microservice-nvidia
env_file:
- MySQL.env
- Shinobi.env
environment:
- "TZ=Europe/Berlin"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./config:/config
- ./videos:/opt/shinobi/videos
- /dev/shm/shinobiDockerTemp:/dev/shm/streams
# devices:
# - /dev/dri:/dev/dri
ports:
- "8080:8080"
Create .env-files to set the environment variables.
Use .env-files to set the environment variables only ones but use them in many containers. We need environment variables to configure Shinobi and MariaDB at runtime, because the container is stateless.
Create MySQL.env with the following content.
MYSQL_USER=majesticflame
MYSQL_PASSWORD=password
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_DATABASE=ccio
MYSQL_ROOT_PASSWORD=blubsblawoot
MYSQL_ROOT_USER=root
EMBEDDEDDB=false
Notice: Ensure you set
EMBEDDEDDB=false. Otherwise your setup will use a local SQLite database.
Create Shinobi.env with the following content.
[email protected]
ADMIN_PASSWORD=admin
CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f
PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57
PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d
PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi
MOTION_HOST=localhost
MOTION_PORT=8080
PASSWORD_HASH=sha256
PRODUCT_TYPE=Pro
To start the Shinobi stack just type:
$ docker-compose up -d
If you want to stop the stack run docker-compose down.
The stack should be up and running.
Well, that's a bit like a Shinobi stack without a stack. We do not need to launch a private MariaDB server, but we have to connect to an already existing one. Here we go.
The Shinobi container creates the database on your MariaDB server, creates the user account for Shinobi and sets the required privileges, if you specify MYSQL_ROOT_USER and MYSQL_ROOT_PASSWORD.
You're already running a MariaDB server container like this, right?
$ docker run -d --name [YourMariaDbContainerName] \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v [Path to your MariaDB server data files]:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=[Your very strong MariaDB root password] \
-p 3306:3306 \
mariadb
$ mkdir -p [Path to Shinobi direcory]/config [Path to Shinobi direcory]/datadir [Path to Shinobi direcory]/videos
$ docker run -d \
--link [YourMariaDbContainerName]:db \
-p 8080:8080 \
-e [email protected] \
-e ADMIN_PASSWORD=admin \
-e PASSWORD_HASH=sha256 \
-e PRODUCT_TYPE=Pro \
-e MYSQL_USER=majesticflame\
-e MYSQL_PASSWORD=password\
-e MYSQL_HOST=db \
-e MYSQL_PORT=3306 \
-e MYSQL_DATABASE=ccio \
-e MYSQL_ROOT_PASSWORD=[Your very strong MariaDB root password] \
-e MYSQL_ROOT_USER=[Your MariaDB root username] \
-e CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f \
-e PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57 \
-e PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d \
-e PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi \
-e MOTION_HOST=localhost \
-e MOTION_PORT=8080 \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v [Path to your Shinobi data files]/config:/config \
-v [Path to your Shinobi data files]/videos:/opt/shinobi/videos \
-v /dev/shm/shinobiDockerTemp:/dev/shm/streams \
migoller/shinobidocker:microservice-ffmpeg
docker-compose.yml file in the directory [Path to Shinobi direcory] like this.
version: '2'
services:
app:
# image: migoller/shinobidocker:microservice-alpine
image: migoller/shinobidocker:microservice-ffmpeg
# image: migoller/shinobidocker:microservice-vaapi
# image: migoller/shinobidocker:microservice-nvidia
env_file:
- MySQL.env
- Shinobi.env
environment:
- "TZ=Europe/Berlin"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./config:/config
- ./videos:/opt/shinobi/videos
- /dev/shm/shinobiDockerTemp:/dev/shm/streams
# devices:
# - /dev/dri:/dev/dri
ports:
- "8080:8080"
That's it.
Well, that's quite easy, too. You will just have to create a single container for Shinobi without any MariaDB setup.
First create directories for Shinobi's database, video and configuration files.
$ mkdir -p [Path to Shinobi direcory]/config [Path to Shinobi direcory]/datadir_sqlite [Path to Shinobi direcory]/videos
Create a docker-compose.yml file in the directory [Path to Shinobi direcory] with the following content.
version: '2'
services:
app:
# image: migoller/shinobidocker:microservice-alpine
image: migoller/shinobidocker:microservice-ffmpeg
# image: migoller/shinobidocker:microservice-vaapi
# image: migoller/shinobidocker:microservice-nvidia
env_file:
- SQLite.env
- Shinobi.env
environment:
- "TZ=Europe/Berlin"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./datadir_sqlite:/opt/dbdata:rw
- ./config:/config
- ./videos:/opt/shinobi/videos
- /dev/shm/shinobiDockerTemp:/dev/shm/streams
ports:
- "8080:8080"
Create .env-files to set the environment variables.
Use .env-files to set the environment variables only ones but use them in many containers. We need environment variables to configure Shinobi and MariaDB at runtime, because the container is stateless.
Create SQLite.env with the following content.
EMBEDDEDDB=true
Create Shinobi.env with the following content.
[email protected]
ADMIN_PASSWORD=admin
CRON_KEY=b59b5c62-57d0-4cd1-b068-a55e5222786f
PLUGINKEY_MOTION=49ad732d-1a4f-4931-8ab8-d74ff56dac57
PLUGINKEY_OPENCV=6aa3487d-c613-457e-bba2-1deca10b7f5d
PLUGINKEY_OPENALPR=SomeOpenALPRkeySoPeopleDontMessWithYourShinobi
MOTION_HOST=localhost
MOTION_PORT=8080
PASSWORD_HASH=sha256
PRODUCT_TYPE=Pro
To start the Shinobi stack just type:
$ docker-compose up -d
If you want to stop the stack run docker-compose down.
The stack of only one container should be up and running.
The first time start will take a few seconds, because the Shinobi container creates the database on your MariaDB server, creates the user account for Shinobi and sets the required privileges, if you specify MYSQL_ROOT_USER and MYSQL_ROOT_PASSWORD.
Now try to open Shinobi's super admin UI. Open your Docker host's IP address in your web browser on port 8080. Open the superuser panel to create an account.
Web Address : http://xxx.xxx.xxx.xxx:8080/super
Username : [email protected]
Password : admin
After account creation head on over to the main Web Address and start using Shinobi!
http://xxx.xxx.xxx.xxx:8080/
Enjoy.
Breaking changes: The new Shinobi for Docker all-in-one images
alpine,ffmpeg,vaapiandnvidiaand the microservice imagesmicroservice-alpine,microservice-ffmpeg,microservice-vaapiandmicroservice-nvidiasupport write-back to your customconf.jsonfile!
Shinobi for Docker uses environment variables for basic or initial setup. But you can provide any existing and customized conf.json to the Docker container. Settings you'll modify using the Shinobi Super User's UI will be stored in your conf.json. Just mount your conf.json into the container per file or per directory:
version: '2'
services:
app:
image: migoller/shinobidocker:microservice-ffmpeg
env_file:
- SQLite.env
- Shinobi.env
environment:
- "TZ=Europe/Berlin"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./datadir_sqlite:/opt/dbdata:rw
- ./config/conf.json:/opt/shinobi/conf.json
- ./videos:/opt/shinobi/videos
- /dev/shm/shinobiDockerTemp:/dev/shm/streams
ports:
- "8080:8080"
Shinobi for Docker will setup the /opt/shinobi/conf.json inside of the container if it's missing or if it's empty.
The container startup script will only try to update the /opt/shinobi/conf.json file regarding the provided environment variables.
Recommendation: I recommend to set the needed environment variables for initial setup accordingly to your runtime environment.
- Shinobi will create an initial setup including configuration files like
/opt/shinobi/conf.jsonfor you. So you can modify the file later on to fit your needs.- Just mount a configuration file like
conf.jsonon your Docker host to/opt/shinobi/conf.jsoninside of the Shinobi container.
These are the environment variables to setup Shinobi.
| Variable | Defaults to | Mandatory | Description |
|---|---|---|---|
ADMIN_USER | [email protected] | yes | The super user's login name. |
ADMIN_PASSWORD | admin | yes | The super user's secret password. |
CRON_KEY | b59b5c62-57d0-4cd1-b068-a55e5222786f | no | Set to a private secret unique key for CRON. |
PLUGINKEY_MOTION | 49ad732d-1a4f-4931-8ab8-d74ff56dac57 | no | Set to a private secret unique key for motion plugin. |
PLUGINKEY_OPENCV | 6aa3487d-c613-457e-bba2-1deca10b7f5d | no | Set to a private secret unique key for opencv plugin. |
PLUGINKEY_OPENALPR | SomeOpenALPRkeySoPeopleDontMessWithYourShinobi | no | Set to a private secret unique key for openalpr plugin. |
MOTION_HOST | localhost | no | Host for motion plugin. |
MOTION_PORT | 8080 | no | Port for motion plugin on MOTION_HOST. |
PASSWORD_HASH | sha256 | no | Password hash algorithm [md5 |
PRODUCT_TYPE | no | Set to Pro to enable the Shinobi Pro features. | |
EMBEDDEDDB | false | no | Set to true to switch to SQLite database. Otherwise you have to provide MariaDB information. |
These are the environment variables to setup MariaDB / MySQL for Shinobi.
| Variable | Defaults to | Mandatory | Description |
|---|---|---|---|
EMBEDDEDDB | false | no | Enables MariaDB / MySQL backend for Shinobi. |
MYSQL_USER | majesticflame | no | The Shinobi database username. |
MYSQL_PASSWORD | password | no | The Shinobi database username's secret password. |
MYSQL_HOST | db | no | The MariaDB / MySQL host to connect to. |
MYSQL_PORT | 3306 | no | The MariaDB / MySQL port for MYSQL_HOST |
MYSQL_DATABASE | ccio | no | Name of database for Shinobi. |
MYSQL_ROOT_PASSWORD | blubsblawoot | no | Password of MariaDB / MySQL root user account. |
MYSQL_ROOT_USER | root | no | Username of MariaDB / MySQL root user account. |
The first time start will take a few seconds
Content type
Image
Digest
Size
245.8 MB
Last updated
about 6 years ago
docker pull migoller/shinobiv2:readme