无法在docker debian中安装包:jessie

前端之家收集整理的这篇文章主要介绍了无法在docker debian中安装包:jessie前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

postgres图像基于debian:jessie

dockerfile

  1. FROM postgres:9.4
  2. RUN apt-get -qq update
  3. RUN apt-get install git-core
  4. RUN apt-get install osm2pgsql

无法找到git和osm2​​pgsql

错误

  1. E: Unable to locate package git-core

我错过了什么?

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

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

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

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

猜你在找的Docker相关文章