Skip to content

Commit ec61156

Browse files
authored
Merge pull request #1 from Rose-STL-Lab/claude/review-docker-lxc-docs-011CV3bTQMJMCvgPhUsSaXMZ
Review Docker in LXC technical documentation
2 parents b375a52 + 87d3814 commit ec61156

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

docs/guide/docker.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,83 @@ sudo systemctl start docker
122122

123123
## Common Issues and Solutions
124124

125+
### AppArmor Permission Denied (Docker 29.0+)
126+
127+
::: danger Common Issue with Docker 29.0+
128+
Docker 29.0 introduced security changes (CVE-2025-52881 fix) that may cause permission denied errors in LXC containers. If you encounter these errors, follow the solutions below.
129+
:::
130+
131+
**Symptoms:**
132+
```bash
133+
# Docker service won't start
134+
sudo systemctl status docker
135+
# Shows: Failed to start Docker Application Container Engine
136+
137+
# Or containers fail with permission errors:
138+
docker run hello-world
139+
# Error: permission denied
140+
```
141+
142+
**Solution 1: Add AppArmor Override When Running Containers (Recommended)**
143+
144+
Add `--security-opt apparmor=unconfined` to your Docker commands:
145+
146+
```bash
147+
# Single container
148+
docker run --rm --security-opt apparmor=unconfined hello-world
149+
150+
# With other options
151+
docker run -d \
152+
--name myapp \
153+
--security-opt apparmor=unconfined \
154+
-p 3000:3000 \
155+
myimage:latest
156+
```
157+
158+
**For Docker Compose**, add to your `docker-compose.yml`:
159+
```yaml
160+
version: '3.8'
161+
services:
162+
web:
163+
image: myimage
164+
security_opt:
165+
- apparmor=unconfined
166+
ports:
167+
- "3000:3000"
168+
```
169+
170+
**Solution 2: Set Global Docker Default**
171+
172+
To avoid adding `--security-opt` to every command, set it globally in Docker daemon config:
173+
174+
```bash
175+
sudo vim /etc/docker/daemon.json
176+
```
177+
178+
Add `default-security-opt`:
179+
```json
180+
{
181+
"storage-driver": "fuse-overlayfs",
182+
"default-security-opt": ["apparmor=unconfined"]
183+
}
184+
```
185+
186+
Restart Docker:
187+
```bash
188+
sudo systemctl restart docker
189+
190+
# Verify
191+
docker info | grep -i apparmor
192+
```
193+
194+
::: warning Security Note
195+
Setting AppArmor to `unconfined` reduces container isolation. This is generally acceptable in LXC environments since the LXC container itself provides isolation. However, avoid running untrusted code without additional security measures.
196+
:::
197+
198+
**If the above solutions don't work:**
199+
200+
Contact your system administrator (RoseLab users: ziz244@ucsd.edu) to verify that your LXC container is configured for nested container support.
201+
125202
### Permission Denied on Docker Socket
126203

127204
If you encounter:

0 commit comments

Comments
 (0)