gb28181-docking-platform-mo.../package-docker.sh

28 lines
1.2 KiB
Bash
Raw Normal View History

2023-09-04 15:43:50 +08:00
#!/bin/bash
# 用于缓存打包过程下载的依赖
mkdir repository
curDir=`pwd`
2023-09-16 16:39:45 +08:00
repository=${curDir}/repository
2023-09-16 16:43:08 +08:00
if ! test -e ${curDir}/gb28181-mocking-starter/ffmpeg;then
2023-09-16 16:35:49 +08:00
xz -d ${curDir}/ffmpeg/ffmpeg-git-amd64-static.tar.xz
2023-09-16 16:38:50 +08:00
tar -xvf ${curDir}/ffmpeg/ffmpeg-git-amd64-static.tar -C ${curDir}/ffmpeg/
mv ${curDir}/ffmpeg/ffmpeg-git*-static/* ${curDir}/ffmpeg
rm -rf ${curDir}/ffmpeg/ffmpeg-git*-static
2023-09-16 16:46:47 +08:00
mkdir -p ${curDir}/gb28181-mocking-starter/ffmpeg
cp ${curDir}/ffmpeg/ffmpeg ${curDir}/gb28181-mocking-starter/ffmpeg
cp ${curDir}/ffmpeg/ffprobe ${curDir}/gb28181-mocking-starter/ffmpeg
cp -r ${curDir}/ffmpeg/model ${curDir}/gb28181-mocking-starter/ffmpeg
2023-09-16 16:25:13 +08:00
fi
2023-09-04 15:43:50 +08:00
docker run --name maven --rm \
-v ${curDir}:/usr/src/mymaven \
2023-09-16 16:39:45 +08:00
-v ${repository}:/root/.m2/repository \
2023-09-04 15:43:50 +08:00
-v ${curDir}/settings.xml:/usr/share/maven/ref/settings.xml \
-v /etc/docker/daemon.json:/etc/docker/daemon.json -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker \
-w /usr/src/mymaven \
maven:3.9.3-eclipse-temurin-17-alpine \
mvn clean package -DskipTests -Pdocker
2023-09-04 16:41:58 +08:00
docker save skcks.cn/gb28181-docking-platform-mocking -o gb28181-docking-platform-mocking.image
2023-09-04 15:43:50 +08:00
ls -lh *.image