docker - 在 alpine 上安装 MongoDB 的问题

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb==3.4.4-r0

RUN mongo --version

错误

ERROR: unsatisfiable constraints:
so:libboost_chrono-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_chrono-mt.so.1.62.0]
so:libboost_filesystem-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_filesystem-mt.so.1.62.0]
so:libboost_iostreams-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_iostreams-mt.so.1.62.0]
so:libboost_program_options-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_program_options-mt.so.1.62.0]
so:libboost_regex-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_regex-mt.so.1.62.0]
so:libboost_system-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_system-mt.so.1.62.0]
so:libboost_thread-mt.so.1.62.0 (missing):
required by:
mongodb-3.4.4-r0[so:libboost_thread-mt.so.1.62.0]
so:libcrypto.so.41 (missing):
required by:
mongodb-3.4.4-r0[so:libcrypto.so.41]
so:libssl.so.43 (missing):

最佳答案

MongoDB 版本 3.4.4-r0位于Alpine v3.6 community存储库并需要另一个包,如 boost , boost-iostreams , boost-dev等版本1.62.0-r5要安装。它们仅在 Alpine v3.6 main 中可用存储库。您只需要将该存储库也添加到 alpine 存储库的列表中:

RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
RUN apk add mongodb=3.4.4-r0

RUN mongo --version

你可能感兴趣的:(docker,mongodb,容器)