redash oracle image data source docker

redash official docker image is not included oracle, we need to add their own, a docker reference image for a simple modification

Dockerfile

FROM redash/redash:7.0.0.b18042
USER root
# Oracle instantclient
ADD oracle/instantclient-basic-linux.x64-12.2.0.1.0.zip /tmp/instantclient-basic-linux.x64-12.2.0.1.0.zip
ADD oracle/instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip
ADD oracle/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
RUN apt-get update -y
RUN apt-get install -y unzip
RUN unzip /tmp/instantclient-basic-linux.x64-12.2.0.1.0.zip -d /usr/local/
RUN unzip /tmp/instantclient-sdk-linux.x64-12.2.0.1.0.zip -d /usr/local/
RUN unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/
RUN ln -s /usr/local/instantclient_12_2 /usr/local/instantclient
RUN ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so
RUN ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus
RUN apt-get install libaio-dev -y
RUN apt-get clean -y
ENV ORACLE_HOME=/usr/local/instantclient
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/instantclient
RUN pip install cx_Oracle==5.3
USER redash
#Add REDASH ENV to add Oracle Query Runner 
ENV REDASH_ADDITIONAL_QUERY_RUNNERS=redash.query_runner.oracle

Explanation

In fact the official document provides some simple instructions in oracle
reads as follows:

 
# Requires installation of, or similar versions of:
# oracle-instantclient12.2-basic_12.2.0.1.0-1_x86_64.rpm
# oracle-instantclient12.2-devel_12.2.0.1.0-1_x64_64.rpm
cx_Oracle==5.3
 
 

On top of the mirrored reference https://github.com/joaoleite/redash_oracle , specify the new oracle client and python bag
and if you need to enable oracle, you need to add REDASH_ADDITIONAL_QUERY_RUNNERSan environment variable, content

 
ENV REDASH_ADDITIONAL_QUERY_RUNNERS=redash.query_runner.oracle

docker-compose run

  • docker-compose documents
version: '3'
services:
  server:
    image: dalongrong/redash-oracle:7.0.0.b18042
    command: server
    env_file: ./opt/redash/env
    ports:
      - "5000:5000"
    environment:
      REDASH_WEB_WORKERS: 4
  scheduler:
    image: dalongrong/redash-oracle:7.0.0.b18042
    command: scheduler
    env_file: ./opt/redash/env
    environment:
      QUEUES: "celery"
      WORKERS_COUNT: 1
  scheduled_worker:
    image: dalongrong/redash-oracle:7.0.0.b18042
    command: worker
    env_file: ./opt/redash/env
    environment:
      QUEUES: "scheduled_queries,schemas"
      WORKERS_COUNT: 1
  adhoc_worker:
    image: dalongrong/redash-oracle:7.0.0.b18042
    command: worker
    env_file: ./opt/redash/env
    environment:
      QUEUES: "queries"
      WORKERS_COUNT: 2
  repeat:
    Image: repeat: 5.0 - Alpine
    restart: always
  postgres:
    image: postgres:9.5-alpine
    env_file: ./opt/redash/env
    volumes:
      - ./opt/redash/postgres-data:/var/lib/postgresql/data
    restart: always
  nginx:
    image: redash/nginx:latest
    ports:
      - "80:80"
    depends_on:
      - server
    links:
      - server:redash
    restart: always
  • Environment variables described
    in detail with reference to an environment variable can opt / redash / env
  • start up
 
docker-compose up -d
docker-compose run --rm server create_db

effect

 

Explanation

docker image I have a push dockerhubdalongrong/redash-oracle

Reference material

https://github.com/joaoleite/redash_oracle
https://github.com/rongfengliang/redash_oracle
https://github.com/getredash/redash/blob/master/requirements_oracle_ds.txt

Guess you like

Origin www.cnblogs.com/rongfengliang/p/11234255.html