正确安装了Dockerfile依赖项,但生成的映像没有

时间:2016-12-25 10:32:05

标签: ubuntu docker dockerfile

我有以下Dockerfile:

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

用:

运行它
sudo docker build -t my_step1 .

我看到底线是:

Successfully built b7f1e789d8e8 

看起来很有希望。但是,尝试一下,我得到了:

avidane$ docker run -it my_step1 bash
root@e6756cdd93bd:/# add-apt-repository
bash: add-apt-repository: command not found

我错过了什么?

1 个答案:

答案 0 :(得分:0)

这个问题非常具体针对Ubuntu和Debian所以它可能属于askubuntu.com it's been asked already

在基于Debian jessie 的所有Ubuntu版本中,您会在包add-apt-repository中找到python-software-common

sudo apt-get install python-software-common

在基于Debian wheezy 的所有Ubuntu版本中,您会在包add-apt-repository中找到python-software-properties

sudo apt-get install python-software-properties

提示:在终端中输入cat /etc/debian_version,找出当前Ubuntu发行版所基于的Debian版本。

所有jessie / wheezy 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 trusty中搜索文件add-apt-repositoryhttp://packages.ubuntu.com/search?searchon=contents&keywords=add-apt-repository&mode=exactfilename&suite=trusty&arch=any

File                            Packages 
/usr/bin/add-apt-repository     software-properties-common
相关问题