Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tar command not found in Dockerfile

I am trying to download a file in rhel6 and use tar to uncompress it. I am running this on docker. I get a wierd error saying /bin/sh: tar: command not found. I am new to linux and docker. Can someone help.

#HELLO
FROM rhel6
MAINTAINER xxxxx

#RUN yum -y install wget

RUN yum update -y && yum clean all

#RUN yum -y install tar

RUN curl -OL  http://username:[email protected]/enterprise/dse-4.0.3-bin.tar.gz

RUN curl -OL  http://username:[email protected]/enterprise/opscenter-4.0.3.tar.gz

RUN echo $PATH

RUN tar -xzvf opscenter-4.0.3.tar.gz

RUN rm *.tar.gz
like image 811
user892871 Avatar asked Dec 23 '14 02:12

user892871


1 Answers

Very strange...this wasn't happening...then all of a sudden started happening. I'm not sure why, but I got around it by installing tar.x86_64:

FROM centos:6
RUN     yum -y update && \
    yum -y install wget && \
    yum install -y tar.x86_64 && \
    yum clean all
like image 159
hba Avatar answered Oct 02 '22 01:10

hba