无法在docker debian中安装包:jessie

我是tryint在基于debian的容器中安装git

postgres图像基于debian:jessie

dockerfile

FROM postgres:9.4


RUN apt-get -qq update

RUN apt-get install git-core
RUN apt-get install osm2pgsql

无法找到git和osm2​​pgsql

错误

E: Unable to locate package git-core

我错过了什么?

最佳答案
我不知道导致’无法找到包’错误的原因,但是你的apt-get调用缺失了-y,这意味着你将得到:

After this operation,33.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c apt-get install git-core' returned a non-zero code: 1

否则,您的Dockerfile对我来说效果很好:

Step 1 : RUN apt-get -qq update
 ---> Running in 0430a990fa81
 ---> 54f88a02d81e
Removing intermediate container 0430a990fa81
Step 2 : RUN apt-get install git-core
 ---> Running in 0fdad2e3c35b
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  ca-certificates git git-man less libcurl3-gnutls liberror-perl libidn11
  librtmp1 libssh2-1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6
  libxmuu1 openssh-client patch rsync xauth
Suggested packages:
  gettext-base git-daemon-run git-daemon-sysvinit git-doc git-el git-email
  git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn ssh-askpass
  libpam-ssh keychain monkeysphere ed diffutils-doc openssh-server
Recommended packages:
  ssh-client
The following NEW packages will be installed:
  ca-certificates git git-core git-man less libcurl3-gnutls liberror-perl
  libidn11 librtmp1 libssh2-1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6
  libxext6 libxmuu1 openssh-client patch rsync xauth
0 upgraded,21 newly installed,0 to remove and 1 not upgraded.
Need to get 8,059 kB of archives.
After this operation,33.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Abort.
The command '/bin/sh -c apt-get install git-core' returned a non-zero code: 1
ERROR: Failed to build larsks/sodocker:latest

相关文章

Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的 Li...
1、什么是docker?答:docker是开源的应用容器引擎;开发人员把他们的应用及依赖包打包发布到容器当中。...
1、什么是namespace? 答:名称空间,作用隔离容器 2、namespace隔离有那些? 答:ipc:共享内存、消息队...
1、Docker能在非Linux平台(Windows+MacOS)上运行吗? 答:可以 2 、如何将一台宿主机的docker环境...
环境要求: IP hostname 192.168.1.1 node1 项目规划: 容器网段:172.16.10.0/24 NGINX:172.16.10.10...
文档上传地址:https://files.cnblogs.com/files/lin-strive/07-docker%E8%B7%A8%E4%B8%BB%E6%9C%BA%E7...