使用docker在vm中执行sftp时发生封闭pipe道错误

我有一个dockerized的骆驼路由器的容器,从远程主机sftp到VM本地文件夹。 如果我只是以传统的方式(例如java -jar my-sftp-camel-router.jar)在VM中运行我的代码,它会下载所有5000个文件。 但是,当我使用docker run -P / tmp /:/ tmp / my-sftp-camel-router-image像docker镜像一样运行时,它在下载大约12个文件后失败。 这两种情况在我的本地机器上正常工作,但在虚拟机上没有问题

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: / at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:576) at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:533) at org.apache.camel.component.file.remote.SftpOperations.buildDirectory(SftpOperations.java:472) at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:106) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:43) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:367) at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:137) at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:226) at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:190) at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: 4: at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:359) at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:574) ... 17 more Caused by: java.io.IOException: Pipe closed at java.io.PipedInputStream.read(PipedInputStream.java:307) at java.io.PipedInputStream.read(PipedInputStream.java:377) at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2882) at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2908) at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:2328) at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:342) ... 18 more