docker - Problems installing MongoDB on alpine

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
mistake

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):

Best answer

MongoDB version 3.4.4-r0 is located in the Alpine v3.6 community repository and requires another package such as boost, boost-iostreams, boost-dev, etc. version 1.62.0-r5 to be installed. They are only available in the Alpine v3.6 main repository. You just need to add this repository to the list of alpine repositories as well:

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

Guess you like

Origin blog.csdn.net/ichen820/article/details/132758771