Docker 错误:IO::Pipe:无法执行:没有这样的文件或目录
我不熟悉Docker和Perl。 我想对perl应用程序进行dockerize,但在运行时出现以下错误:Docker 错误:IO::Pipe:无法执行:没有这样的文件或目录,docker,perl,ubuntu,io,cpan,Docker,Perl,Ubuntu,Io,Cpan,我不熟悉Docker和Perl。 我想对perl应用程序进行dockerize,但在运行时出现以下错误: Error: IO::Pipe: Cannot exec: No such file or directory 这是我的Dockerfile: FROM ubuntu:18.04 RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y libimage-magick
Error: IO::Pipe: Cannot exec: No such file or directory
这是我的Dockerfile:
FROM ubuntu:18.04
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y libimage-magick-perl && \
apt install -y make && \
apt install -y gcc && \
apt install -y perl && \
apt install -y cpanminus
RUN cpan install YAML
RUN cpan install IPC::Run
WORKDIR /opt
COPY . /opt/deploy
ENTRYPOINT ["perl", "/opt/deploy/bin/deploy"]
这是我使用IO::Pipe模块的文件:
package Deployment::Log::File;
use strict;
use warnings;
use base 'Tie::Handle';
use constant TRUE => (1 == 1);
use constant FALSE => (0 == 1);
use Fcntl qw(:flock);
use IO::File;
use IO::Pipe;
use Symbol;
use Sys::Hostname;
use Text::ParseWords;
use Time::HiRes;
...
my $class = shift; $class = ref($class) if ref($class);
my $destination = shift;
my $layout = shift;
my $handle;
if ($destination =~ s/^\s*\|\s*//) {
my @token = map { $class->interpolate($_) } Text::ParseWords::shellwords($destination);
$handle = IO::Pipe->new;
$handle->writer(@token)
or return undef;
我尝试用cpan和cpanm安装IO::Pipe和IO,但没有任何效果。有人能帮我吗?
$token[0]
应该包含要运行的程序的名称。它可以是路径或简单的文件名(内核使用path
env var将其解析为路径)
您提供了一个简单的文件名,并且在PATH
env var指定的任何目录中都找不到具有该名称的可执行文件,或者您提供了一个不存在的文件的路径
可能程序对其当前工作目录的假设不正确?可能需要查看一些代码。我假设您检查了/opt/deploy/bin/deploy,/opt和/opt/deploy存在并具有正确的权限?@TLP您能快速告诉我如何在docker环境中执行此操作吗?@TLP我检查过,但/opt/deploy/bin/deploy不在任何目录中这是我运行的脚本。您没有显示令牌数组的设置。错误很可能是由于该命令不存在,所以无法执行由令牌指定的命令行