From 45b5e7d78910a6ac2c4108067da6be50f5551d04 Mon Sep 17 00:00:00 2001 From: Giorgio Sironi Date: Mon, 20 Aug 2018 13:38:13 +0100 Subject: [PATCH 1/2] Do not recommend --system for a Docker context Despite an application's Docker container not usually running other Python processes than the application itself, it still has a system Python whose packages should not necessarily be overwritten or upgraded by an application's choices. For example, `python3-software-properties` in Ubuntu contains utilities written in Python like `add-apt-repository` whose [use is widespread in Dockerfiles](https://github.com/search?l=Dockerfile&q=%22add-apt-repository%22&type=Code). By inadvertently applying an application's dependency onto the the container's Python, it is possible to: - subtly break system-level software like these that is still present in the container image - run into errors where that software is executed while extending the image with another Dockerfile - run into errors when `docker run|exec ... COMMAND` is used to run another process inside the same container for debugging purposes I realize this is not necessarily a likely use case, but we have seen enough projects/tools vendoring `Requests` in fear of a conflict. Very open on the wording and whether `system Python` is the correct term to designate the global Python for that OS/container image. --- docs/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index ceaf64d5..6179959d 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -110,7 +110,7 @@ You can tell Pipenv to install a Pipfile's contents into its parent system with $ pipenv install --system -This is useful for Docker containers, and deployment infrastructure (e.g. Heroku does this). +This is useful for managing the system Python, and deployment infrastructure (e.g. Heroku does this). Also useful for deployment is the ``--deploy`` flag:: From 7c512a5eb954f53c183cf8f5001b8abd321b8987 Mon Sep 17 00:00:00 2001 From: Giorgio Sironi Date: Mon, 20 Aug 2018 13:57:32 +0100 Subject: [PATCH 2/2] Add news fragment for --system Docker recommendation --- news/2762.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2762.doc diff --git a/news/2762.doc b/news/2762.doc new file mode 100644 index 00000000..d2e6fe48 --- /dev/null +++ b/news/2762.doc @@ -0,0 +1 @@ +Stopped recommending `--system` for Docker contexts.