2017-10-29 233 views
1

我正在使用Dockerfile並且無法傳遞此錯誤。我對這個錯誤進行了很多研究,但似乎找不到解決方案。在Docker容器中運行Apache Cassandra

代碼:
從Ubuntu的:值得信賴的

RUN echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list 
RUN sudo apt-get install -y curl nginx 
RUN sudo apt-get update 
RUN curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - 
RUN sudo apt-get update 
RUN sudo apt-get install cassandra 
RUN sudo service cassandra -fR 

錯誤:...

E: Unable to locate package curl 
E: Unable to locate package nginx 
The command '/bin/sh -c sudo apt-get install -y curl nginx' returned a non-zero code: 100 

即使我安裝捲曲和nginx的。請幫助

回答

1

運行apt-get update安裝curl之前。執行卷曲安裝時,軟件包列表不是最新的。此外,你將不得不得到openjdk-8-jre-headless值得信賴安裝cassandra:

FROM ubuntu:trusty 
RUN echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | tee -a /etc/apt/sources.list.d/cassandra.sources.list 
RUN apt-get update 
RUN apt-get install -y software-properties-common && add-apt-repository ppa:openjdk-r/ppa -y && apt-get update 
RUN apt-get install -y curl nginx 
RUN curl https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add - && sudo apt-get update 
RUN apt-get install -y cassandra 
RUN service cassandra start 
相關問題