]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
docker: Make .env file optional
authorStephen Finucane <stephen@that.guru>
Fri, 12 Jul 2024 13:32:43 +0000 (14:32 +0100)
committerStephen Finucane <stephen@that.guru>
Fri, 12 Jul 2024 14:02:29 +0000 (14:02 +0000)
I now have a standard UID and GID of 1000, making this file unnecessary.

Signed-off-by: Stephen Finucane <stephen@that.guru>
README.rst
docs/development/installation.rst
tools/docker/Dockerfile

index 979801fb31f5cd08626a9cc18d14c1317204f1ed..ebde1f363e2a5b32c8a7ef565b8321a0073ffde1 100644 (file)
@@ -85,11 +85,14 @@ environment. To install Patchwork:
 
        $ git clone https://github.com/getpatchwork/patchwork.git
 
-3. Create a ``.env`` file in the root directory of the project and store your
-   ``UID`` and ``GID`` attributes there::
+3. (Optional) Create a ``.env`` file in the root directory of the project and
+   store your ``UID`` and ``GID`` attributes there::
 
        $ cd patchwork && printf "UID=$(id -u)\nGID=$(id -g)\n" > .env
 
+   This should only be necessary if you have a ``UID`` or ``GID`` other than
+   ``1000``.
+
 4. Build the images. This will download a number of packages from the internet,
    and compile several versions of Python::
 
index 6f4920a629957aa7618cfec4d53c2f47f89f0af9..c33f768b15e661191c1dd778f17e786dc725360c 100644 (file)
@@ -30,14 +30,20 @@ configure Patchwork using Docker:
         package.
   __ post-install_
 
-#. Create a ``.env`` file in the root directory of the project and store your
-   ``UID`` and ``GID`` attribute there.
+#. (Optional) Create a ``.env`` file in the root directory of the project and
+   store your ``UID`` and ``GID`` attribute there.
 
    .. code-block:: shell
 
       $ echo "UID=$UID" > .env
       $ echo "GID=`id -g`" >> .env
 
+   This should only be necessary if you have a ``UID`` or ``GID`` other than
+   ``1000``. For more information on why this is necessary, refer to this
+   `docker-compose issue`__.
+
+   __ https://github.com/docker/compose/issues/2380
+
 #. Build the images. This will download over 200MB from the internet:
 
    .. code-block:: shell
@@ -140,18 +146,6 @@ For more information on Docker itself, please refer to the `docker`_ and
 
    __ post-install_
 
-.. note::
-
-   If you see an error like the below::
-
-     You must define UID in .env
-
-   Ensure you have created a ``.env`` file in the root of your project
-   directory and stored the ``UID`` attribute there. For more information on
-   why this is necessary, refer to this `docker-compose issue`__.
-
-   __ https://github.com/docker/compose/issues/2380
-
 .. _docker: https://docs.docker.com/engine/install/
 .. _docker-compose: https://docs.docker.com/compose/install/
 .. _post-install: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user
index bdae67a278475c8b63cc9e30d19426710dcf8461..0a55b54dbebf4ead2b8e14316122e74ddb59d579 100644 (file)
@@ -1,13 +1,7 @@
 FROM ghcr.io/getpatchwork/pyenv:latest
 
-ARG UID
-ARG GID
-
-# make sure the user has configured the '.env' file and quick fail if not
-
-RUN echo $UID; echo $GID; \
-    [ -n "$UID" ] || { echo "You must define UID in .env" 1>&2; exit 1; }; \
-    [ -n "$GID" ] || { echo "You must define GID in .env" 1>&2; exit 1; }
+ARG UID=1000
+ARG GID=1000
 
 ARG TZ="Australia/Canberra"
 ENV DEBIAN_FRONTEND noninteractive