until v7 I could install packages on docker image but now it’s failing due permission errors…

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/elasticsearch-7.0.5.dist-info'
Consider using the `--user` option or check the permissions.

I guess using --user would not work when running server, would it?
how should I proceed to install new packages (in this case, elasticsearch) ?

Hi @fcordova! Can you please provide a full command(s) you run to build an image? Thanks!

Hi @levko, thanks for you reply…

I’m actually trying to create another image using the following dockerfile:

FROM redash/redash:8.0.0.b32245

RUN pip install elasticsearch

As you can see, pretty straightforward…

During the image’s build process one of the last commands we run is to switch the user to redash:

In your Dockerfile you will need to change the user again before running the pip install command.

Btw, what are you installing elasticsearch for?

Hi arikfr… it worked fine, thanks…

I install elasticsearch because I have some python scripts that load data from it before processing the data to return it to Redash’s model…

‘You could use elasticsearch data source’, you’d say, but data in elasticsearch is not flat so I have to ‘unwind’ some collections to get the data I need. I also add some statistics, etc…

In mongodb I can create a pipeline to work data properly without using a python script, but I didn’t find a way to do that in elasticsearch :frowning_face:

If you need elasticsearch - no need to install it in Redash container; use power of Docker - just start separate elasticsearch container in the same network with Redash and you’ll be able to access it. If you use docker compose - you can just add a new service to docker-compose.yml

Can you share an example for those scripts?

There is work being done to improve the Elasticsearch connector, so it might be useful to see real use cases.