Ubuntu Dockerfile依赖项已正确安装,但生成的映像不';我没有

Ubuntu Dockerfile依赖项已正确安装,但生成的映像不';我没有,ubuntu,docker,dockerfile,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 bas

我有以下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

我遗漏了什么?

这个问题是Ubuntu和Debian特有的,所以它可能属于askubuntu.com

在所有基于Debianjessie的Ubuntu版本中,您可以在包
python软件common
中找到
AddAPTRepository

sudo apt-get install python-software-common
在所有基于Debianwheezy的Ubuntu版本中,您可以在包
python软件属性
中找到
添加apt存储库

sudo apt-get install python-software-properties
提示:在终端中键入
cat/etc/debian\u 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

如果在Dockerfile中添加
RUN apt get-y install software properties common
,该怎么办?非常感谢。@jdo您可以创建一个作者可以接受的答案。
File                            Packages 
/usr/bin/add-apt-repository     software-properties-common