github.com/rohankumardubey/proxyfs@v0.0.0-20210108201508-653efa9ab00e/run_docker_tests.sh (about) 1 #!/bin/bash 2 3 set -e 4 5 IMAGE=$1 6 7 if [ -z "$IMAGE" ] 8 then 9 echo "usage: $0 build|pull" 10 exit 1 11 fi 12 13 if [ "$IMAGE" == "build" ]; then 14 set -x 15 # That's how you run it from scratch 16 docker build -t proxyfs_unit_tests test/container 17 docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS proxyfs_unit_tests 18 elif [ "$IMAGE" == "pull" ]; then 19 set -x 20 # That's how you run it using the image on Docker Hub 21 docker run --cap-add SYS_ADMIN --device /dev/fuse -it -v `pwd`:/gopathroot/src/github.com/swiftstack/ProxyFS swiftstack/proxyfs_unit_tests 22 else 23 echo "Bad argument: $IMAGE" 24 exit 1 25 fi