nginx-proxy-tester.sh 1.3 KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. ###############################################################################
  3. # #
  4. # This script is meant to run the test suite from a Docker container. #
  5. # #
  6. # This is usefull when you want to run the test suite from Mac or #
  7. # Docker Toolbox. #
  8. # #
  9. ###############################################################################
  10. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  11. ARGS="$@"
  12. # check requirements
  13. if [[ "$(docker images -q nginx-proxy-tester 2>/dev/null)" == "" ]]; then
  14. echo "> Building nginx-proxy-tester image..."
  15. docker build -t nginx-proxy-tester -f $DIR/requirements/Dockerfile-nginx-proxy-tester $DIR/requirements
  16. fi
  17. # run the nginx-proxy-tester container setting the correct value for the working dir in order for
  18. # docker-compose to work properly when run from within that container.
  19. exec docker run --rm -it \
  20. -v ${DIR}:/${DIR}:ro \
  21. -w ${DIR} \
  22. -v /var/run/docker.sock:/var/run/docker.sock \
  23. nginx-proxy-tester ${ARGS}