I have the following DockerFile
FROM apache/superset:pr-19860
RUN pip install elasticsearch-dbapi
RUN superset superset fab create-admin
--username admin
--firstname Superset
--lastname Admin
--email [email protected]
--password admin
RUN superset superset db upgrade
RUN superset superset load_examples
RUN superset superset init
ADD https://github.com/domsoltel/superset/blob/436efe104938d0ca555bb99c586f3d2675a69a59/config.py /app/superset/
ADD https://github.com/domsoltel/superset/blob/436efe104938d0ca555bb99c586f3d2675a69a59/viz.py /app//superset/
I have to modify the config.py
and viz.py
file to make it work the way I want it to. These files already exist in the superset container but I need to modify a few variables
If I do docker cp
it works perfectly, from my pc to the container it works perfectly but with the dockerfile I get the following error
PermissionError: [Errno 13] Permission denied: ‘/app/superset/config.py’
I think it might be a permissions problem, how can I fix it?
2
Answers
Since you’re using
docker-compose
; then use volumes to map those filesNote that volumes must be an absolute path to work with mapping files (unlike mapping directories)
Another note: if the file is in-use by the container; then you’ll get the permission error anyway!
The superset image is set up to run as the user
superset
which doesn’t have full permissions. So before your change anything, you should switch toroot
and then back to thesuperset
user when you´re done.You can see an example at the bottom of the page for the image (under ‘How to extend this image’): https://hub.docker.com/r/apache/superset
I’ve also changed the URLs of the files to the raw versions. With the URLs you had, you would add HTML versions of the files which isn’t going to work.