Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

docker实战 - 安装superset

  • 拉取镜像

    docker pull apache/superset:latest
    
  • 创建docker卷用作持久化

    docker volume create superset-db-host
    docker volume create superset-config-host
    
  • 启动容器

    docker run -itd -p 8088:8088 --mount source=superset-config-host,target=/app/pythonpath --mount source=superset-db-host,target=/app/superset_home --name superset-2.0 apache/superset:latest
    
  • 提前执行生成key,用作下面的SECRET_KEY

    openssl rand -base64 42
    
  • 进入容器内

    docker exec -it superset-2.0 /bin/bash
    
  • 写配置文件

    cd pythonpath
    
    echo "SECRET_KEY = 'CRXFQqFjpy8IXDcsY5MYWryHrtOUraV+eTU66JF51/CPIgE2A8H1GhXk'" > superset_config.py
    
    echo "BABEL_DEFAULT_LOCALE = 'zh'" >> superset_config.py
    
    echo "BABEL_DEFAULT_FOLDER = '/app/superset/translations'" >> superset_config.py
    
    echo "
    

LANGUAGES = { 'en' : { 'flag' : 'us' , 'name' : 'English' }, 'fr' : { 'flag' : 'fr' , 'name' : 'French' }, 'zh' : { 'flag' : 'cn' , 'name' : 'Chinese' }, } " >> superset_config.py ```

  • 编译汉化文件

    cd /app/superset
    
    pybabel compile -d translations
    
  • 退出容器

    exit
    
  • 容器外执行 账户创建

    docker exec -it superset-2.0 superset fab create-admin  --username admin  --firstname Superset  --lastname Admin  --email account@17lianqin.cn
    
  • 容器外执行 初始化

    docker exec -it superset-2.0 superset db upgrade
    
    docker exec -it superset-2.0 superset init
    
  • 容器外执行 安装greenplum使用的jdbc

    docker exec -it superset-2.0 pip3 install psycopg2
    
  • 重启容器

    docker restart superset-2.0
    
  • 访问8088端口,用上面创建的账户登录