Docker Community Forums

Share and learn in the Docker community.

Tar command not found in rhel6

(Nkimidi) #1


I am new to linux and docker. I am trying to download a file and tar it.
But it says /bin/sh: tar: command not found.

Can some one help. This is my dockerfile:

FROM rhel6

#RUN yum -y install wget

RUN yum update -y && yum clean all

#RUN yum -y install tar

RUN curl -OL

RUN curl -OL

RUN echo $PATH

RUN tar -xzvf opscenter-4.0.3.tar.gz

RUN rm *.tar.gz

(slamp) #2

Try the full path of tar:
RUN /bin/tar -xzvf opscenter-4.0.3.tar.gz

(Nkimidi) #3

I tried /bin/tar /usr/bin/tar. But none of them worked.

(slamp) #4

You should connect to your docker and check the result of “yum -y install tar”.
I guess the command failed. Maybe because you do not register your RHEL6 and so you can not install new packages.