potiuk commented on a change in pull request #15592: URL: https://github.com/apache/airflow/pull/15592#discussion_r623154921
########## File path: docs/docker-stack/entrypoint.rst ########## @@ -96,6 +96,28 @@ Airflow image is Open-Shift compatible, which means that you can start it with r group id ``0`` (``root``). If you want to run the image with user different than Airflow, you MUST set GID of the user to ``0``. In case you try to use different group, the entrypoint exits with error. +OpenShift randomly assigns UID when it starts the container, but you can utilise this flexible UID +also in case of running the image manually. This might be useful for example in case you want to +mount ``dag`` and ``logs`` folders from host system on Linux, in which case the UID should be set +the same ID as your host user. + +This can be achieved in various ways - you can change USER when you extend or customize the image or +you can dynamically pass the user to ``docker run`` command, by adding ``--user`` flag in one of +those formats (See `Docker Run reference <https://docs.docker.com/engine/reference/run/#user>`_ for details): + +``` +[ user | user:group | uid | uid:gid | user:gid | uid:group ] +``` + +In case of Docker Compose environment it can be changed via ``user:`` entry in the ``docker-compose.yaml``. +See `Docker compose reference <https://docs.docker.com/compose/compose-file/compose-file-v3/#domainname-hostname-ipc-mac_address-privileged-read_only-shm_size-stdin_open-tty-user-working_dir>`_ +for details. In our Quickstart Guide using Docker-Compose, the UID and GID can be passed via +``AIRFLOW_UID`` and ``AIRFLOW_GID`` variables as described in +ref:`Initializing docker compose environment <_initializing_docker_compose_environment>`. Review comment: ```suggestion :ref:`Initializing docker compose environment <_initializing_docker_compose_environment>`. ``` -- 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. For queries about this service, please contact Infrastructure at: [email protected]
