This pull request tries to solve several issues related to the Dockerfile. Some of those have already been discussed in corona-zahlen-landkreis/corona_landkreis_fallzahlen_scraping#62. Mainly, the following things will be improved:
Dockerfile
Removed the 2 VOLUME directives, because their purpose remained unclear
Mount the source code into the container at /landkreise
Preserve file ownership mirroring the host user UID/GID
Dropping root privileges as soon as possible (e.g. installing python packages only at user-scope)
Removed the last RUN directive, because it does nothing
Moved the Dockerfile into the subfolder holding the python source code which hopefully makes the context more clear and improves the Docker build step
Makefile
I could not really get the rational behind using the parameter --userns=host. It seems to be only used for a very specific use-case (see Disable namespace remapping for a container. Hence, I removed this makefile target.
But for the case, it has been used to tackle the file ownership problem (see: Add ability to mount volume as user other than root, this is now be handled by the creation of a user based on the host's UID/GID.
This pull request tries to solve several issues related to the Dockerfile. Some of those have already been discussed in corona-zahlen-landkreis/corona_landkreis_fallzahlen_scraping#62. Mainly, the following things will be improved:
Dockerfile
/landkreise
Makefile
--userns=host
. It seems to be only used for a very specific use-case (see Disable namespace remapping for a container. Hence, I removed this makefile target. But for the case, it has been used to tackle the file ownership problem (see: Add ability to mount volume as user other than root, this is now be handled by the creation of a user based on the host's UID/GID.