Docker-superset安装

发布时间 2023-04-03 11:12:54作者: edclol

Docker-superset安装

https://superset.apache.org/index.html

https://hub.docker.com/r/apache/superset

Start a superset instance on port 8032

$ docker run -d -p 8032:8088 --name superset apache/superset:latest 

Initialize a local Superset Instance

With your local superset container already running...

  1. Setup your local admin account

    $ docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
    
  2. Migrate local DB to latest

    $ docker exec -it superset superset db upgrade
    
  3. Load Examples

    # 网络不好的情况下,这一步可以跳过
    $ docker exec -it superset superset load_examples
    
  4. Setup roles

    $ docker exec -it superset superset init
    
  5. Login and take a look -- navigate to http://localhost:8083/login/ -- u/p: [admin/admin]

How to extend this image

This docker image contains only the base Superset build, excluding database drivers that you will need to connect to your analytics DB (MySQL, Postgres, BigQuery, Snowflake, Redshift, etc.) This is deliberate as many of these drivers do not have Apache-compatible license, and we do not want to bloat the image with packages you do not need in your environment.

We do recommend that you write a simple docker file based on this image. Here's what it may look like:

FROM apache/superset
# Switching to root to install the required packages
USER root
# Example: installing the MySQL driver to connect to the metadata database
# if you prefer Postgres, you may want to use `psycopg2-binary` instead
RUN pip install mysqlclient
# Example: installing a driver to connect to Redshift
# Find which driver you need based on the analytics database
# you want to connect to here:
# https://superset.apache.org/installation.html#database-dependencies
RUN pip install sqlalchemy-redshift
# Switching back to using the `superset` user
USER superset

Find the recommended Python libraries for popular databases here: https://superset.apache.org/installation.html#database-dependencies