2016-12-25 125 views
2

我有以下Dockerfile:Dockerfile依賴安裝正確,但得到的圖像沒有它

sudo docker build -t my_step1 . 

我看到的底線是:

Successfully built b7f1e789d8e8 

FROM ubuntu:trusty 
RUN apt-get update 
RUN apt-get -y install python-software-properties 

與運行它

看起來很有前途。然而,嘗試它我得到:

avidane$ docker run -it my_step1 bash 
[email protected]:/# add-apt-repository 
bash: add-apt-repository: command not found 

我錯過了什麼?

+2

如果您添加了'RUN apt-get -y install software-properties-常見的Dockerfile? – jDo

+1

這很有用,非常感謝。 –

+1

@jdo您可以創建一個可以被作者接受的答案。 – dixon1e

回答

0

這個問題是非常具體的Ubuntu和Debian,所以它可能屬於askubuntu.com it's been asked already

在基於Debian 傑西的Ubuntu的所有版本,你會在包裝python-software-common找到add-apt-repository

sudo apt-get install python-software-common 

在基於Debian 喘息的Ubuntu的所有版本中,你會發現add-apt-repository在包python-software-properties

sudo apt-get install python-software-properties 

提示:在終端型cat /etc/debian_version找到取出您當前的Ubuntu發行版所基於的Debian版本。

所有傑西/喘息的Ubuntu版本:

15.10 wily  jessie/sid 
15.04 vivid  jessie/sid 
14.10 utopic  jessie/sid 
14.04 trusty  jessie/sid <-- the OP is using trusty/jessie 
13.10 saucy  wheezy/sid 
13.04 raring  wheezy/sid 
12.10 quantal wheezy/sid 
12.04 precise wheezy/sid 
11.10 oneiric wheezy/sid 

你可以看一下包和特定的文件包中的位置: http://packages.ubuntu.com/

在Ubuntu值得信賴的搜索文件add-apt-repository

File       Packages 
/usr/bin/add-apt-repository  software-properties-common 
相關問題