Issue installing MongoDB on alpine

前端 未结 4 1003
耶瑟儿~
耶瑟儿~ 2021-01-04 18:58
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
         


        
4条回答
  •  清酒与你
    2021-01-04 19:09

    This worked for me... probably it will work for you 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
    
    VOLUME ["/data/db"]
    WORKDIR /data
    EXPOSE 27017
    

    Use /data folder because it is the defult one. Other names will give you error.

提交回复
热议问题