rhel6에서 tar 명령을 찾을 수 없습니다.

rhel6에서 tar 명령을 찾을 수 없습니다.

rhel6에서 파일을 다운로드하고 tar를 사용하여 압축을 풀려고 합니다. 나는 이것을 도커에서 실행하고 있습니다. 이상한 오류가 발생합니다.

/bin/sh: tar: command not found
2014/12/22 19:32:21 The command [/bin/sh -c tar -xzvf dse-4.0.3-bin.tar.gz] returned a non-zero code: 127
#
#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

답변1

사용 중인 Docker 컨테이너는 tar 유틸리티를 제공하지 않습니다. 나는 다음을 사용하여 이것을 테스트했습니다.

sudo docker run -i -t rhel6 /bin/bash

그러면 rhel6 이미지를 사용하여 Docker에서 대화형 셸이 생성되고 거기에서 표시되는 오류를 대화형으로 검사할 수 있습니다.

bash-4.1# find / -name tar
bash-4.1# yum list | grep -i tar
upstart.x86_64               0.6.5-13.el6_5.3               @koji-override-0/6.5

두 명령 모두 tar가 설치되지 않았으며 사용할 수 없음을 보여줍니다.

rhel을 사용하는 이유나 Docker 컨테이너에서 rhel의 라이센스가 어떻게 부여되는지 잘 모르겠지만 tar를 표준으로 제공하는 CentOS를 사용할 수 있다면;

sudo docker run -i -t centos /bin/bash
bash-4.1# yum list | grep -i tar
---snip---
tar.x86_64                               2:1.26-29.el7                   base   
---snip---

관련 정보