Dockerfile依赖安装正确,但得到的图像没有它
问题描述:
我有以下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
我错过了什么?
答
这个问题是非常具体的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
如果您添加了'RUN apt-get -y install software-properties-常见的Dockerfile? – jDo
这很有用,非常感谢。 –
@jdo您可以创建一个可以被作者接受的答案。 – dixon1e