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
Build and Push Docker Images / build-and-push (push) Successful in 17s
This commit is contained in:
@@ -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"]
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user