瀏覽代碼

测试容器vpis

dengsixing 2 周之前
父節點
當前提交
4fca0eeaf8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

+ 2 - 2
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -184,7 +184,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
 
             //切图
             //切图
 //            String fragmentCmd = "vips copy " + origFilePath + "[autorot] " +workPath + "--dzsave";
 //            String fragmentCmd = "vips copy " + origFilePath + "[autorot] " +workPath + "--dzsave";
-            String fragmentCmd = "docker run --rm -v /mnt:/mnt vips:8.15.1 vips dzsave --tile-size "  + tileSize + " " + origFilePath + "[autorot] " +  workPath;
+            String fragmentCmd = "docker run --rm --security-opt seccomp=unconfined --pids-limit=4096 -v /mnt:/mnt vips:8.15.1 vips dzsave --tile-size "  + tileSize + " " + origFilePath + "[autorot] " +  workPath;
             log.info("fragmentCmd:{}" + fragmentCmd);
             log.info("fragmentCmd:{}" + fragmentCmd);
             CmdUtils.callLine(fragmentCmd);
             CmdUtils.callLine(fragmentCmd);
             if(!ComputerUtil.checkComputeCompleted(dziPath, 5, 200)){
             if(!ComputerUtil.checkComputeCompleted(dziPath, 5, 200)){
@@ -205,7 +205,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             Integer maxSize = height > width ? height : width;
             Integer maxSize = height > width ? height : width;
             if(maxSize > size){
             if(maxSize > size){
                 String thumbnailPath =  workPath + "/" + thumbnailName;
                 String thumbnailPath =  workPath + "/" + thumbnailName;
-                String scaleCmd = "docker run --rm -v /mnt:/mnt vips:8.15.1 vipsthumbnail " + origFilePath  + " -s " + size + " -o " + thumbnailPath;
+                String scaleCmd = "docker run --rm --security-opt seccomp=unconfined --pids-limit=4096 -v /mnt:/mnt vips:8.15.1 vipsthumbnail " + origFilePath  + " -s " + size + " -o " + thumbnailPath;
                 CmdUtils.callLine(scaleCmd);
                 CmdUtils.callLine(scaleCmd);
                 if(!ComputerUtil.checkComputeCompleted(thumbnailPath, 5, 200)){
                 if(!ComputerUtil.checkComputeCompleted(thumbnailPath, 5, 200)){
                     throw new BusinessException(ErrorCode.FAILURE_CODE_5052);
                     throw new BusinessException(ErrorCode.FAILURE_CODE_5052);