2017-07-06 158 views
-2

我試圖使用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 
+0

我已經嘗試安裝bzip2的,但得到了同樣的錯誤。 – nadish

回答

0

這工作:

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