MINOR: Add Docker version requirement and permission warning to README (#19994)

Adds a new section **"Installation Preparation"** to the Kafka Docker
examples README. It documents a known issue with Docker versions prior
to 20.10.4, where directory permissions (such as `/opt/kafka/config`)
are not properly set, causing startup failures for non-root users (e.g.,
`appuser`).

This issue was fixed in Docker [20.10.4
release](https://docs.docker.com/engine/release-notes/20.10/#20104),
specifically in Use 0755 permissions when creating missing directories
[moby/moby#42017](https://github.com/moby/moby/pull/42017).

Reviewers: Jhen-Yung Hsu <jhenyunghsu@gmail.com>, Lan Ding
 <isDing_L@163.com>, Chia-Ping Tsai <chia7712@gmail.com>

---------

Co-authored-by: Jhen-Yung Hsu <yungyung7654321@gmail.com>
This commit is contained in:
Logan Zhu 2025-06-19 17:07:45 +08:00 committed by GitHub
parent ce996b34e9
commit 772b7c2a5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,25 @@ Kafka server can be started using following ways:
- File input - File input
- Environment variables - Environment variables
Installation Preparation
------------
Note that the `Docker` version **must be >= 20.10.4**.
The prior Docker versions may cause permission errors when running the Kafka container, as they do not correctly set directory permissions when creating container paths like `/opt/kafka/config`.
If you are using the prior version, you may encounter the following error during container startup:
```text
===> User
uid=1000(appuser) gid=1000(appuser) groups=1000(appuser)
===> Setting default values of environment variables if not already set.
===> Configuring …
Running in KRaft mode…
/opt/kafka/config/ file not writable
```
To avoid this, **please upgrade Docker to 20.10.4 or later**.
Running on default configs Running on default configs
-------------------------- --------------------------