I am trying to run a custom zap proxy using the below dockerfile:
# Use the stable ZAP base image
FROM softwaresecurityproject/zap-bare
# Environment variables to configure ZAP
ENV HUD=false
ENV API_DISABLEKEY=true
ENV API_ADDRS=0.0.0.0/0
ENV ZAP_AUTO_UPDATE=false
# Expose the default ZAP port
EXPOSE 8080
CMD ["zap.sh", "-daemon", "-port", "8080", "-config", "api.disablekey=true", "-config", "api.addrs.addr.name=.*", "-config", "api.addrs.addr.regex=true", "-config", "view.mode=attack", "-silent"]
i build and run my container using these two commands:
docker build -t custom-zap .
and
docker run -p 8080:8080 --name custom-zap custom-zap
So, i expect the port 8080 on my local machine be mapped to the container. But, when i open the browser, i cannot get the API documentation on http://localhost:8080/
Although, I can see the zap proxy is running well in the container as i see the below logs:
2024-05-16 12:54:45 4580 [ZAP-daemon] INFO org.zaproxy.addon.callhome.ExtensionCallHome - Shh! Silent mode or telemetry turned off
2024-05-16 12:54:45 4589 [ZAP-daemon] INFO org.zaproxy.addon.network.ExtensionNetwork - ZAP is now listening on localhost:8080