泊坞窗tar命令不工作
问题描述:
我试图使用tar命令泊坞窗tar命令不工作
tar -xjvf samtools-0.1.18.tar.bz2
我能不搬运工运行tar命令解压samtools-0.1.18.tar.bz2。但是当我尝试使用docker解压它时,它给了我错误。有人可以请帮助。
Dockerfile:
FROM amazonlinux
RUN yum -y install bzip2
WORKDIR /sharedData
RUN echo "Installing SMTOOLS."
ADD https://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2 /sharedData
RUN tar -xjvf samtools-0.1.18.tar.bz2
错误:
Step 5/6 : ADD https://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2 /sharedData
Downloading 130.2 kB
---> c524de5863ce
Removing intermediate container 941f57797c7b
Step 6/6 : RUN tar -xjvf samtools-0.1.18.tar.bz2
---> Running in 0391b2f5bf9c
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
The command '/bin/sh -c tar -xjvf samtools-0.1.18.tar.bz2' returned a non-zero code: 2
答
这工作:
FROM amazonlinux
WORKDIR /sharedData
RUN yum install -y bzip2
RUN yum install -y wget
RUN wget https://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1.18.tar.bz2
RUN tar -xjvf samtools-0.1.18.tar.bz2
+0
@ Peri461的确,ADD主要是为下载文件而设计的。 – Robert
我已经尝试安装bzip2的,但得到了同样的错误。 – nadish