I’m running a zap server with docker in order to run scans and then run jest test against the result. Locally it is working fine since the server is running on 0.0.0.0:8081 and in the tests i’m proxying zap to localhost:8081 but on circleci the server is running on 0.0.0.0:8081 and the circleci address is set to 127.0.0.1 resulting in test failures. Anyone has an idea of how to change circle’s host address and make it run on localhost instead of 127.0.0.1 ? Even if i change the proxy and run the server on 127.0.0.1 it is still not working.
Try removing the -host 0.0.0.0 in the command line. Perhaps it has to bind to the remote localhost and not to the (private) LAN IP?
Also, try SSHing in after a failed build and do a netstat to see if something is listening on 8081. The binding to localhost is a CircleCI device - it is a network between your build container and the remote server running the server container.
You may need to search the web for the correct commands to netstat to get the most useful report.
I tried removing the -host 0.0.0.0 in the command and got the server to run on localhost. it seems i don’t have an issue with the port being in use. Here’s the error i’m logging:
Remote Docker engine created. Using VM 'default-ab7e9746-2032-4668-ba13-453b9664e53f'
Created container accessible with:
DOCKER_CERT_PATH=/tmp/docker-certs025086737
DOCKER_HOST=tcp://104.196.152.141:2376
DOCKER_MACHINE_NAME=36896556
DOCKER_TLS_VERIFY=1
NO_PROXY=127.0.0.1,localhost,circleci-internal-outer-build-agent,104.196.152.141:2376
I’m assuming proxy needs to be enabled on the remote docker to be able to reach the server but in the documentation there is no additional info on this other than the setup and caching.