Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ubtuntu Docker:可靠和安装python开发_Python_Docker_Ubuntu_Apt Get - Fatal编程技术网

ubtuntu Docker:可靠和安装python开发

ubtuntu Docker:可靠和安装python开发,python,docker,ubuntu,apt-get,Python,Docker,Ubuntu,Apt Get,谢谢你看这个。我使用 唯一不同的是我用的是ubuntu:trusty 在此之后,我启动了容器,并将ssh插入容器中,然后我尝试安装python,结果如下: root@a20f46f358b3:/script/docker/ubuntu-trusty# sudo apt-get -qq -y --no- install-recommends install python-dev E: Unable to correct problems, you have held broken package

谢谢你看这个。我使用

唯一不同的是我用的是ubuntu:trusty

在此之后,我启动了容器,并将ssh插入容器中,然后我尝试安装python,结果如下:

root@a20f46f358b3:/script/docker/ubuntu-trusty# sudo apt-get -qq -y --no- 
install-recommends install python-dev
E: Unable to correct problems, you have held broken packages.
root@a20f46f358b3:/peloton/peloton/script/docker/ubuntu-trusty# sudo apt-get  
install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python-dev : Depends: libpython-dev (= 2.7.5-5ubuntu3) but it is not going 
to be installed
          Depends: python2.7-dev (>= 2.7.5-1~) but it is not going to be 
installed
E: Unable to correct problems, you have held broken packages.
我应该使用不同的图像来创建容器吗

没有保存的包,我通过执行进行验证,没有输出

dpkg --get-selections | grep hold
我能做些什么来解决这个问题?非常感谢您的指导

问候,, ~Ash

试试Dockerfile

RUN apt-get update && sudo apt-get upgrade
FROM ubuntu:16.04
检查

试用Dockerfile

RUN apt-get update && sudo apt-get upgrade
FROM ubuntu:16.04
检查


我最终使用了ubuntu:16.04,这对我来说很有效。我把以下内容放在我的Dockerfile中

RUN apt-get update && sudo apt-get upgrade
FROM ubuntu:16.04
此外,我还使用以下命令来运行ssh服务器

希望这能帮助其他遇到这个问题的人

问候,,
~Ash

我最终使用了ubuntu:16.04,这对我来说很有用。我把以下内容放在我的Dockerfile中

RUN apt-get update && sudo apt-get upgrade
FROM ubuntu:16.04
此外,我还使用以下命令来运行ssh服务器

希望这能帮助其他遇到这个问题的人

问候,,
~Ash

你几乎不应该在dockerfile中运行获取升级,也不应该使用sudo eitherHi@anthony。。谢谢你的留言,但是你能分享一下为什么你不应该在Dockerfile中运行apt-get-upgrade吗。这是因为这应该是启动容器的一部分吗?apt get upgrade ~通常会导致生成的docker映像大小增加一倍,因为每个包都将在多个层中复制。您最好的选择是在构建之前通常使用docker,这样您就有了最新的基本映像,并依靠它来拥有最新的包。链接dockerfile中的实际错误是,它们在单独的层中有apt get update和apt get install,这会导致层缓存问题。您几乎不应该在dockerfile中运行apt get upgrade,也不应该使用sudo eitherHi@anthony。。谢谢你的留言,但是你能分享一下为什么你不应该在Dockerfile中运行apt-get-upgrade吗。这是因为这应该是启动容器的一部分吗?apt get upgrade ~通常会导致生成的docker映像大小增加一倍,因为每个包都将在多个层中复制。您最好的选择是在构建之前通常使用docker,这样您就有了最新的基本映像,并依靠它来拥有最新的包。链接dockerfile中的实际错误是,它们在单独的层中有apt get update和apt get install,从而导致层缓存问题。