Update puppeteer healthcheck Dockerfile to run as root for Docker socket access and enhance README with common error resolution steps.
Build and Push Docker Images / build-and-push (push) Successful in 17s

This commit is contained in:
2025-07-02 10:05:48 +02:00
parent db85c56c5f
commit 275542b6ee
2 changed files with 20 additions and 1 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ RUN groupadd -g 999 docker || true && \
useradd -r -g docker -u 999 healthcheck && \ useradd -r -g docker -u 999 healthcheck && \
chown -R healthcheck:docker /app chown -R healthcheck:docker /app
USER healthcheck # Don't switch user - run as root for Docker socket access
# USER healthcheck
# Run the healthcheck script # Run the healthcheck script
CMD ["python", "healthcheck.py"] CMD ["python", "healthcheck.py"]
+18
View File
@@ -110,6 +110,24 @@ If you see "Permission denied" errors when accessing the Docker socket:
docker run --user root ... docker run --user root ...
``` ```
### Common Error: "Connection aborted. PermissionError(13, 'Permission denied')"
This error occurs when the container cannot access the Docker socket. To fix:
1. **Mount the Docker socket**:
```bash
-v /var/run/docker.sock:/var/run/docker.sock:ro
```
2. **Add the container to the docker group**:
```bash
--group-add $(getent group docker | cut -d: -f3)
```
3. **Use the provided docker-compose.yml** which includes all necessary configurations.
### Container not found ### Container not found
- Ensure the `TARGET_CONTAINER` environment variable matches the exact name of your puppeteer-api container - Ensure the `TARGET_CONTAINER` environment variable matches the exact name of your puppeteer-api container