MartinKChen commented on issue #22149: URL: https://github.com/apache/superset/issues/22149#issuecomment-1790329413
I refer to the [Dockerfile](https://github.com/apache/superset/blob/master/Dockerfile) where building dev layer from lean layer. And come out with a new custom Dockerfile, where switch user to **_root_** before COPY and RUN `pip install`, then switch back to the user **_superset_**. Now authlib and apache-superset[databricks] are both been installed correctly without additional `pip install` under bootstrapScript. Following is my latest Dockerfile: ``` FROM apache/superset:3.0.1 USER root COPY ./requirements.txt . RUN pip install --no-cache-dir -r ./requirements.txt USER superset ``` --- Note: I had tried different ways to copy requirements.txt before added switching user, and none of them install extra libraries successfully. ``` # Rename the file when copy, in case any constraint with the file name "requirements.txt" COPY ./requirements.txt ./rename.txt # Change owner when copy the file into image COPY --chown=superset:superset ./requirements.txt . # Copy file into requirements directory, instead of under root directory COPY ./requirements.txt requirements/requirements_custom.txt # Combine both approaches above COPY --chown=superset:superset ./requirements.txt requirements/requirements_custom.txt ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
