【发布时间】:2019-07-13 21:31:12
【问题描述】:
直到今天早上,我的容器构建过程都很顺利,现在我遇到了apt get -y mongodb 的一些问题。
我有一个非常简单的 Dockerfile,发布了相关代码,因为这是重现问题所需的全部内容。
FROM python:2.7
RUN apt-get update && \
apt-get -y install \
gpg \
mongodb \
我已经研究了一些修复方法,但它们似乎有点过火了,我应该只更改我的基本映像吗?我正在尝试了解此错误背后的原因以及如何在未来证明它。
注意,我忘了放痕迹。
Sending build context to Docker daemon 1.354GB
Step 1/7 : FROM python:2.7
2.7: Pulling from library/python
5ae19949497e: Pull complete
ed3d96a2798e: Pull complete
f12136850781: Pull complete
1a9ad5d5550b: Pull complete
6f18049a0455: Pull complete
900d7861659d: Pull complete
536c9e631831: Pull complete
cb522be31b83: Pull complete
d03d3d7b603d: Pull complete
Digest: sha256:ee76dd856d06bdd734e1c3c816b243c984586629708f0a3e32038f94a891a5d8
Status: Downloaded newer image for python:2.7
---> 3edf9092825f
Step 2/7 : RUN apt-get update && apt-get -y install gpg mongodb curl
---> Running in 870a931ec60c
Get:1 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]
Get:2 http://deb.debian.org/debian buster InRelease [118 kB]
Get:3 http://security.debian.org/debian-security buster/updates/main amd64 Packages [11.9 kB]
Get:4 http://deb.debian.org/debian buster-updates InRelease [46.8 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7897 kB]
Fetched 8113 kB in 4s (1805 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package mongodb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb' has no installation candidate
The command '/bin/sh -c apt-get update && apt-get -y install gpg mongodb curl' returned a non-zero code: 100
【问题讨论】:
标签: mongodb docker docker-compose mongodb-query containers