Skip to content

Commit fe649ce

Browse files
docs(getting-started-docker-compose): clarify macOS/Windows Docker Desktop data-dir step (#1124)
Operators on macOS and Windows following the docker-compose quickstart hit `docker compose up` failures because the page tells them to run `sudo chown -R 10000 data`, with only a very quiet inline comment ("this step might not be necessary on other than Linux platforms"). Docker Desktop handles uid remapping for bind mounts inside its Linux VM, so the chown step is not only unnecessary on Desktop hosts, it typically leaves `./data/...` in a state that prevents the bookie and zookeeper containers from starting (they fail with permission errors on their data directories). Rework the step so the Linux path stays verbatim and add an explicit `:::note macOS and Windows (Docker Desktop)` admonition that tells the user to skip `chown` and, if they already ran it, to reset `./data` before retrying `docker compose up`. Applied to `docs/` (current) and versioned_docs for the three most recent active LTS lines (3.3.x, 4.1.x, 4.2.x). Older versioned docs are intentionally not backported. Fixes apache/pulsar#23137
1 parent 3611551 commit fe649ce

4 files changed

Lines changed: 60 additions & 8 deletions

File tree

docs/getting-started-docker-compose.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,27 @@ services:
126126
127127
## Step 2: Create a Pulsar cluster
128128
129-
As preparation, create data directories and change the data directory ownership to uid(10000) which is the default user id used in the Pulsar Docker container.
129+
As preparation, create the data directories that the `compose.yml` file will bind-mount into the Pulsar containers.
130+
131+
On Linux, the mounted directories need to be owned by uid `10000` -- the default user inside the Pulsar Docker container -- so the containers can write to them:
130132

131133
```bash
132134
sudo mkdir -p ./data/zookeeper ./data/bookkeeper
133-
# this step might not be necessary on other than Linux platforms
134135
sudo chown -R 10000 data
135136
```
136137

138+
:::note macOS and Windows (Docker Desktop)
139+
140+
On macOS and Windows, Docker Desktop runs containers inside a Linux VM and handles uid remapping for bind mounts for you, so the `chown -R 10000` step is not required and running it with `sudo` will typically fail or leave the files in a state that prevents `docker compose up` from starting cleanly (the bookie/zookeeper containers fail with permission errors on `./data/...`).
141+
142+
If you see permission errors on startup, remove the `./data` directory (or reset its ownership to your user) and create it without `chown`:
143+
144+
```bash
145+
mkdir -p ./data/zookeeper ./data/bookkeeper
146+
```
147+
148+
:::
149+
137150
To create a Pulsar cluster by using the `compose.yml` file, run the following command.
138151

139152
```bash

versioned_docs/version-3.3.x/getting-started-docker-compose.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,27 @@ services:
113113
114114
## Step 2: Create a Pulsar cluster
115115
116-
As preparation, create data directories and change the data directory ownership to uid(10000) which is the default user id used in the Pulsar Docker container.
116+
As preparation, create the data directories that the `compose.yml` file will bind-mount into the Pulsar containers.
117+
118+
On Linux, the mounted directories need to be owned by uid `10000` -- the default user inside the Pulsar Docker container -- so the containers can write to them:
117119

118120
```bash
119121
sudo mkdir -p ./data/zookeeper ./data/bookkeeper
120-
# this step might not be necessary on other than Linux platforms
121122
sudo chown -R 10000 data
122123
```
123124

125+
:::note macOS and Windows (Docker Desktop)
126+
127+
On macOS and Windows, Docker Desktop runs containers inside a Linux VM and handles uid remapping for bind mounts for you, so the `chown -R 10000` step is not required and running it with `sudo` will typically fail or leave the files in a state that prevents `docker compose up` from starting cleanly (the bookie/zookeeper containers fail with permission errors on `./data/...`).
128+
129+
If you see permission errors on startup, remove the `./data` directory (or reset its ownership to your user) and create it without `chown`:
130+
131+
```bash
132+
mkdir -p ./data/zookeeper ./data/bookkeeper
133+
```
134+
135+
:::
136+
124137
To create a Pulsar cluster by using the `compose.yml` file, run the following command.
125138

126139
```bash

versioned_docs/version-4.1.x/getting-started-docker-compose.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,27 @@ services:
126126
127127
## Step 2: Create a Pulsar cluster
128128
129-
As preparation, create data directories and change the data directory ownership to uid(10000) which is the default user id used in the Pulsar Docker container.
129+
As preparation, create the data directories that the `compose.yml` file will bind-mount into the Pulsar containers.
130+
131+
On Linux, the mounted directories need to be owned by uid `10000` -- the default user inside the Pulsar Docker container -- so the containers can write to them:
130132

131133
```bash
132134
sudo mkdir -p ./data/zookeeper ./data/bookkeeper
133-
# this step might not be necessary on other than Linux platforms
134135
sudo chown -R 10000 data
135136
```
136137

138+
:::note macOS and Windows (Docker Desktop)
139+
140+
On macOS and Windows, Docker Desktop runs containers inside a Linux VM and handles uid remapping for bind mounts for you, so the `chown -R 10000` step is not required and running it with `sudo` will typically fail or leave the files in a state that prevents `docker compose up` from starting cleanly (the bookie/zookeeper containers fail with permission errors on `./data/...`).
141+
142+
If you see permission errors on startup, remove the `./data` directory (or reset its ownership to your user) and create it without `chown`:
143+
144+
```bash
145+
mkdir -p ./data/zookeeper ./data/bookkeeper
146+
```
147+
148+
:::
149+
137150
To create a Pulsar cluster by using the `compose.yml` file, run the following command.
138151

139152
```bash

versioned_docs/version-4.2.x/getting-started-docker-compose.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,27 @@ services:
126126
127127
## Step 2: Create a Pulsar cluster
128128
129-
As preparation, create data directories and change the data directory ownership to uid(10000) which is the default user id used in the Pulsar Docker container.
129+
As preparation, create the data directories that the `compose.yml` file will bind-mount into the Pulsar containers.
130+
131+
On Linux, the mounted directories need to be owned by uid `10000` -- the default user inside the Pulsar Docker container -- so the containers can write to them:
130132

131133
```bash
132134
sudo mkdir -p ./data/zookeeper ./data/bookkeeper
133-
# this step might not be necessary on other than Linux platforms
134135
sudo chown -R 10000 data
135136
```
136137

138+
:::note macOS and Windows (Docker Desktop)
139+
140+
On macOS and Windows, Docker Desktop runs containers inside a Linux VM and handles uid remapping for bind mounts for you, so the `chown -R 10000` step is not required and running it with `sudo` will typically fail or leave the files in a state that prevents `docker compose up` from starting cleanly (the bookie/zookeeper containers fail with permission errors on `./data/...`).
141+
142+
If you see permission errors on startup, remove the `./data` directory (or reset its ownership to your user) and create it without `chown`:
143+
144+
```bash
145+
mkdir -p ./data/zookeeper ./data/bookkeeper
146+
```
147+
148+
:::
149+
137150
To create a Pulsar cluster by using the `compose.yml` file, run the following command.
138151

139152
```bash

0 commit comments

Comments
 (0)