Code Monkey home page Code Monkey logo

docker-shinobi's Introduction

Docker - Shinobi

Docker image of Shinobi Video

References

I hope they take my work, improve it and include it inside official repo.

Why I built this image

I want an image for my home kubernetes cluster (mix of raspberry, rock64, celeron)

  • multiarch (at least arm64, x86)
  • with few layers
  • slim, or, at least, not so big
  • with no database server included (I have my own separated mariadb server)
  • a bit less unsecure (without a bunch of libs and shell tools included)

Warning and disclaimer

  • This is not a optimum image.
  • This is provided with no warranty at all.

Supported architectures

ARM64, X86

Where is the docker image

ponte124/shinoby:latest-arm64v8

What's inside

  • Some system packages
  • MySQL client
  • Shinobi app (nodejs), exposing port 8080

Basic usage

  • Docker-compose: (recommended)

    • If you don't have docker-compose installed and you have ARM64... maybe you like https://hub.docker.com/r/szcxo/docker-compose
    • Download this repo (at least docker-compose.yml)
    • Check env variables inside provided docker-compose.yaml

    # docker-compose up -d && docker-compose logs -f

    • First time maybe it doesn't work because of db is not available yet. Just wait a bit and restart shinobi container

    # docker-compose restart shinobi && docker-compose logs -f shinobi

  • Docker command line:

    # docker run -it --rm --name shinobi --link <mariadb-container> -e <ENV>=<VALUE> ponte124/docker-shinobi:latest-arm64v8

Building or customizing the image

First clone this repo. Here there's an old-style simple Makefile:

  • Build:

    # make build

  • Push: You'll need first to customize registry in Makefile and login your registry

    # make push

To Do

I'll do it when I have some time... but if you have time... help is welcome

  • Non-root user

docker-shinobi's People

Contributors

diegosc78 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

docker-shinobi's Issues

docker tag arm64v8-v22.9.2 cant run no mysql-client

In tag arm64v8-v22.9.2 when DB_DISABLE_INCLUDED=true it need mysql-client for init schema, but miss it in docker image

see line 72

    23  if [ "$DB_DISABLE_INCLUDED" = "false" ]; then
    24      echo "MariaDB Directory ..."
    25      ls /var/lib/mysql
    26
    27      if [ ! -f /var/lib/mysql/ibdata1 ]; then
    28          echo "Installing MariaDB ..."
    29          mysql_install_db --user=mysql --datadir=/var/lib/mysql --silent
    30      fi
    31      echo "Starting MariaDB ..."
    32      /usr/bin/mysqld_safe --user=mysql &
    33      sleep 5s
    34
    35      chown -R mysql /var/lib/mysql
    36
    37      if [ ! -f /var/lib/mysql/ibdata1 ]; then
    38          mysql -u root --password="" -e "SET @@SESSION.SQL_LOG_BIN=0;
    39          USE mysql;
    40          DELETE FROM mysql.user ;
    41          DROP USER IF EXISTS 'root'@'%','root'@'localhost','${DB_USER}'@'localhost','${DB_USER}'@'%';
    42          CREATE USER 'root'@'%' IDENTIFIED BY '${DB_PASS}' ;
    43          CREATE USER 'root'@'localhost' IDENTIFIED BY '${DB_PASS}' ;
    44          CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASS}' ;
    45          CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}' ;
    46          GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION ;
    47          GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION ;
    48          GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'%' WITH GRANT OPTION ;
    49          GRANT ALL PRIVILEGES ON *.* TO '${DB_USER}'@'localhost' WITH GRANT OPTION ;
    50          DROP DATABASE IF EXISTS test ;
    51          FLUSH PRIVILEGES ;"
    52      fi
    53
    54      # Create MySQL database if it does not exists
    55      if [ -n "${DB_HOST}" ]; then
    56          echo "Wait for MySQL server" ...
    57          while ! mysqladmin ping -h"$DB_HOST"; do
    58              sleep 1
    59          done
    60      fi
    61
    62      echo "Setting up MySQL database if it does not exists ..."
    63
    64      echo "Create database schema if it does not exists ..."
    65      mysql -e "source /home/Shinobi/sql/framework1.sql" || true
    66
    67      echo "Create database user if it does not exists ..."
    68      mysql -e "source /home/Shinobi/sql/user.sql" || true
    69
    70  else
    71      echo "Create database schema if it does not exists ..."
    72      mysql -u "$DB_USER" -h "$DB_HOST" -p"$DB_PASSWORD" --port="$DB_PORT" --database="$DB_DATABASE" -e "source /home/Shinobi/sql/framework1.sql" || true
    73  fi

I'm not sure what the tag arm64v8-v22.9.2 corresponding shinobi version is, but i found this commit

https://gitlab.com/Shinobi-Systems/Shinobi/-/commit/69db95f8d4d1fb545e924d20c10351772e86bad2

So this docker imager is an unavailable version.
Maybe it would be pleasant to connect the version of this project with shinobi's commit short hash suffix as a tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.