2
0

docker_test.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # cd ~/git/srs
  3. work_dir=$(cd -P $(dirname $0) && cd ../.. && pwd) && cd $work_dir && echo "Run script in ${work_dir}"
  4. if [[ ! -d trunk ]]; then echo "no ./trunk found"; exit 1; fi
  5. echo "For trunk/Dockerfile.test"
  6. docker build --tag srs:test -f trunk/Dockerfile.test . &&
  7. docker build --tag srs:cov -f trunk/Dockerfile.cov .
  8. if [[ $? -ne 0 ]]; then echo "Docker for test failed"; exit 1; fi
  9. echo "For trunk/Dockerfile"
  10. docker buildx build --platform linux/arm/v7 --output "type=image,push=false" --build-arg IMAGE=ossrs/srs:ubuntu20-cache -f trunk/Dockerfile . &&
  11. docker buildx build --platform linux/arm64/v8 --output "type=image,push=false" --build-arg IMAGE=ossrs/srs:ubuntu20-cache -f trunk/Dockerfile . &&
  12. docker buildx build --platform linux/amd64 --output "type=image,push=false" --build-arg IMAGE=ossrs/srs:ubuntu20-cache -f trunk/Dockerfile .
  13. if [[ $? -ne 0 ]]; then echo "Docker for release failed"; exit 1; fi
  14. echo "For trunk/Dockerfile.pkg"
  15. docker build --tag srs:pkg --build-arg version=1.2.3 -f trunk/Dockerfile.pkg .
  16. if [[ $? -ne 0 ]]; then echo "Docker for pkg failed"; exit 1; fi
  17. echo "For trunk/Dockerfile.builds"
  18. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-baseline . &&
  19. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-all . &&
  20. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-webrtc . &&
  21. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-no-asm . &&
  22. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos7-ansi-no-ffmpeg . &&
  23. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos6-baseline . &&
  24. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos6-all . &&
  25. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-baseline . &&
  26. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-all . &&
  27. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-baseline . &&
  28. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu18-all . &&
  29. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-baseline . &&
  30. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-all . &&
  31. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cross-armv7 . &&
  32. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cross-armv7 . &&
  33. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu16-cross-aarch64 . &&
  34. DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target ubuntu20-cross-aarch64 .
  35. if [[ $? -ne 0 ]]; then echo "Docker for build failed"; exit 1; fi