August 2017
Intermediate to advanced
332 pages
9h 16m
English
For the purpose of using docker-compose scale, we didn't specify the port number under which our web service would be published. If we did, then the scaling process would fail because all clones would try to publish under the same port number. On the contrary, we let Docker choose the port. Therefore, we need to change the acceptance_test.sh script to first find what the port number is and then run curl with the correct port number.
#!/bin/bashCALCULATOR_PORT=$(docker-compose port calculator 8080 | cut -d: -f2)test $(curl localhost:$CALCULATOR_PORT/sum?a=1\&b=2) -eq 3
Let's figure out how we found the port number:
Read now
Unlock full access