2014-12-23 4 views
3

rhel6에서 파일을 다운로드하고 tar을 사용하여 압축을 풀려고합니다. 나는 이것을 도커에서 돌리고 있습니다./bin/sh : tar : 명령을 찾을 수 없다는 이상한 오류가납니다. 저는 리눅스와 도커를 처음 사용합니다. 누군가 도와 줄 수 있어요.Dockerfile에서 tar 명령을 찾을 수 없습니다.

#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

는 왜해야합니까? – SvenDowideit

+0

Sven, 그의 Dockerfile에서이 명령을 시도했지만 그 대답은 tar이라는 설치 프로그램을 찾지 못했다는 것입니다. 'yum search tar'는 다양한 것들을 보여 주지만 tar는 아닙니다. – user2915097

답변

1

난 당신이 레드햇 서브 스크립 션 관리에 등록해야 할 수 있음 유사한 하나, richxsl/rhel6.5 강타

$ docker run -it richxsl/rhel6.5 bash [[email protected] /]# tar bash: tar: command not found [[email protected] /]# yum install tar Loaded plugins: product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Setting up Install Process No package tar available. Error: Nothing to do [[email protected] /]#

으로 시도?

0

많은 고통을 겪은 후에 컨테이너 안에 있으면 RHN이나 위성에 등록되어 있지 않다는 것을 알게되었습니다. 가까운 장래에 REDHAT가이 기능을 제공하는지는 의심 스럽습니다.

내가 한 것은 CENTOS에서 필요한 rpm을 얻어 RHEL6 위에 설치하는 것입니다.

RUN curl -OL ftp://fr2.rpmfind.net/linux/centos/6.6/os/x86_64/Packages/unzip-6.0-1.el6.x86_64.rpm 
RUN yum install -y unzip-6.0-1.el6.x86_64.rpm 
RUN rm unzip-6.0-1.el6.x86_64.rpm 

나는 이것이 지금 최고의 전략이라고 생각합니다. 아주 기본적인 RHEL6 이미지를 가져 와서 CENTOS에서 필수 패키지를 설치하십시오. 개발 목적으로이 사용자 정의 RHEL6 이미지를 사용해야합니다.

https://access.redhat.com/articles/881893

2

매우 이상한 ... 이런 일이되지 않았습니다 ... 다음 모든 일이 갑자기 시작의. 왜 그런지 모르겠지만, 설치 tar.x86_64하여 주위에있어 다음`냠 #RUN tar` 라인이 주석 설치를 -y

FROM centos:6 
RUN  yum -y update && \ 
    yum -y install wget && \ 
    yum install -y tar.x86_64 && \ 
    yum clean all