You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -560,6 +560,60 @@ can be found in https://docs.docker.com/config/containers/resource_constraints/#
560
560
561
561
Example: `0`
562
562
563
+
## Troubleshooting
564
+
565
+
### File and Directory Permissions with Volume Mounts
566
+
567
+
When using volume mounts with Docker containers, file and directory permissions can become problematic due to user ID (UID) and group ID (GID) mismatches between the host and container environments.
568
+
569
+
#### Common Permission Issues
570
+
571
+
1. **Root-owned files**: Many Docker images run as root by default, creating files owned by root that the host user cannot modify or delete
572
+
2. **Permission denied errors**: Host files may be inaccessible inside the container if UIDs/GIDs don't match
573
+
3. **Build artifacts**: Generated files may have incorrect ownership, preventing cleanup by the Buildkite agent
574
+
575
+
#### Solutions
576
+
577
+
**Option 1: Use `propagate-uid-gid` (Recommended)**
578
+
```yml
579
+
steps:
580
+
- command: "make build"
581
+
plugins:
582
+
- docker#v5.13.0:
583
+
image: "node:18"
584
+
propagate-uid-gid: true
585
+
```
586
+
This matches the container user's UID/GID to the host user, ensuring files created in volume mounts have correct ownership.
587
+
588
+
**Option 2: Use `chown` for cleanup**
589
+
```yml
590
+
steps:
591
+
- command: "npm run build"
592
+
plugins:
593
+
- docker#v5.13.0:
594
+
image: "node:18"
595
+
chown: true
596
+
```
597
+
This changes ownership of the checkout directory back to the agent user after the container exits.
598
+
599
+
**Option 3: Specify explicit user**
600
+
```yml
601
+
steps:
602
+
- command: "python setup.py build"
603
+
plugins:
604
+
- docker#v5.13.0:
605
+
image: "python:3.9"
606
+
user: "1000:1000" # Match your host user's UID:GID
607
+
```
608
+
609
+
#### Troubleshooting Permission Issues
610
+
611
+
If you encounter permission errors:
612
+
1. Check file ownership with `ls -la` on both host and container
613
+
2. Verify UID/GID matching between host user and container user
614
+
3. Consider using `propagate-uid-gid: true` to automatically handle ID mapping
615
+
4. For persistent issues, use `chown: true` as a fallback solution
616
+
563
617
## Container Labels
564
618
565
619
When running a command, the plugin will automatically add the following Docker labels to the container:
0 commit comments