小编use*_*541的帖子

使用 dockerfile 构建时出现“can't cd”错误

这是完整的 dockerfile

FROM ubuntu:12.04

# Create directory 
RUN mkdir -p /dir/subdir

# Download wget
RUN apt-get install -y wget

# Make sure package is up to date
RUN apt-get update

# Install nodejs
WORKDIR /dir
RUN wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz
RUN tar -zxf node-v0.10.26-linux-x64.tar.gz
RUN cd /node-v0.10.26-linux-x64 && ./configure
RUN cd /node-v0.10.26-linux-x64 && make
RUN cd /node-v0.10.26-linux-x64 && make install

# Update again
RUN apt-get-update

# Copy all the files 
ADD dir/subdir dir/subdir

EXPOSE 8080
CMD ["node", "/dir/subdir/index.js"]
Run Code Online (Sandbox Code Playgroud)

这是日志的一部分,其中出现错误

Step 6 : …
Run Code Online (Sandbox Code Playgroud)

ubuntu node.js docker

3
推荐指数
1
解决办法
2万
查看次数

将数组和变量传递给Perl中的函数

我有一个问题将数组和变量传递给函数.例如,我有以下内容.

 my @the_array = ("hello", "hey");
 CallFunction(@the_array, "random")


 sub CallFunction{
     my (@array_ref, $ran_variable) = @_;

     foreach $element (@array_ref){
         print $element ."\n";
     }
 }
Run Code Online (Sandbox Code Playgroud)

我想要以下输出

hello
hey
Run Code Online (Sandbox Code Playgroud)

但是我在输出中得到了另一个变量,我不知道为什么.

hello
hey
random
Run Code Online (Sandbox Code Playgroud)

perl

0
推荐指数
1
解决办法
111
查看次数

标签 统计

docker ×1

node.js ×1

perl ×1

ubuntu ×1