Skip to content

Commit 0cf8b9d

Browse files
committed
🐛(minio) fix user permission error with Minio and Windows
With Minio Docker and Windows, the user ID needs to be set to `0:0` to avoid permission issues. This change ensures that the Minio container runs with root privileges on Windows, which is necessary for proper file access and management.
1 parent 7be761c commit 0cf8b9d

File tree

4 files changed

+13
-55
lines changed

4 files changed

+13
-55
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to
2121
### Fixed
2222

2323
- 🐛(makefile) Windows compatibility fix for Docker volume mounting #1264
24+
- 🐛(minio) fix user permission error with Minio and Windows #1264
2425

2526

2627
## [3.5.0] - 2025-07-31
@@ -41,9 +42,7 @@ and this project adheres to
4142
- 🔧(project) change env.d system by using local files #1200
4243
- ⚡️(frontend) improve tree stability #1207
4344
- ⚡️(frontend) improve accessibility #1232
44-
- 🛂(frontend) block drag n drop when not desktop
45-
#1239
46-
45+
- 🛂(frontend) block drag n drop when not desktop #1239
4746

4847
### Fixed
4948

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ DB_PORT = 5432
3535

3636
# -- Docker
3737
# Get the current user ID to use for docker run and docker exec commands
38-
DOCKER_UID = $(shell id -u)
39-
DOCKER_GID = $(shell id -g)
40-
DOCKER_USER = $(DOCKER_UID):$(DOCKER_GID)
38+
ifeq ($(OS),Windows_NT)
39+
DOCKER_USER := 0:0 # run containers as root on Windows
40+
else
41+
DOCKER_UID := $(shell id -u)
42+
DOCKER_GID := $(shell id -g)
43+
DOCKER_USER := $(DOCKER_UID):$(DOCKER_GID)
44+
endif
4145
COMPOSE = DOCKER_USER=$(DOCKER_USER) docker compose
4246
COMPOSE_E2E = DOCKER_USER=$(DOCKER_USER) docker compose -f compose.yml -f compose-e2e.yml
4347
COMPOSE_EXEC = $(COMPOSE) exec

bin/_config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function _set_user() {
3838
# options: docker compose command options
3939
# ARGS : docker compose command arguments
4040
function _docker_compose() {
41+
# Set DOCKER_USER for Windows compatibility with MinIO
42+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "${WSL_DISTRO_NAME:-}" ]]; then
43+
export DOCKER_USER="0:0"
44+
fi
4145

4246
echo "🐳(compose) file: '${COMPOSE_FILE}'"
4347
docker compose \

docs/troubleshoot.md

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -83,55 +83,6 @@ If you already have CRLF line endings in your local repository, the **best appro
8383
git commit -m "✏️(project) Fix line endings to LF"
8484
```
8585

86-
## Minio Permission Issues on Windows
87-
88-
### Problem Description
89-
90-
On Windows, you may encounter permission-related errors when running Minio in development mode with Docker Compose. This typically happens because:
91-
92-
- **Windows file permissions** don't map well to Unix-style user IDs used in Docker containers
93-
- **Docker Desktop** may have issues with user mapping when using the `DOCKER_USER` environment variable
94-
- **Minio container** fails to start or access volumes due to permission conflicts
95-
96-
### Common Symptoms
97-
98-
- Minio container fails to start with permission denied errors
99-
- Error messages related to file system permissions in Minio logs
100-
- Unable to create or access buckets in the development environment
101-
- Docker Compose showing Minio service as unhealthy or exited
102-
103-
### Solution for Windows Users
104-
105-
If you encounter Minio permission issues on Windows, you can temporarily disable user mapping for the Minio service:
106-
107-
1. **Open the `compose.yml` file**
108-
109-
2. **Comment out the user directive** in the `minio` service section:
110-
```yaml
111-
minio:
112-
# user: ${DOCKER_USER:-1000} # Comment this line on Windows if permission issues occur
113-
image: minio/minio
114-
environment:
115-
- MINIO_ROOT_USER=impress
116-
- MINIO_ROOT_PASSWORD=password
117-
# ... rest of the configuration
118-
```
119-
120-
3. **Restart the services**:
121-
```bash
122-
make run
123-
```
124-
125-
### Why This Works
126-
127-
- Commenting out the `user` directive allows the Minio container to run with its default user
128-
- This bypasses Windows-specific permission mapping issues
129-
- The container will have the necessary permissions to access and manage the mounted volumes
130-
131-
### Note
132-
133-
This is a **development-only workaround**. In production environments, proper user mapping and security considerations should be maintained according to your deployment requirements.
134-
13586
## Frontend File Watching Issues on Windows
13687

13788
### Problem Description

0 commit comments

Comments
 (0)