Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile中下载的mongodb #264

Open
wolf27w opened this issue Aug 7, 2023 · 3 comments
Open

dockerfile中下载的mongodb #264

wolf27w opened this issue Aug 7, 2023 · 3 comments

Comments

@wolf27w
Copy link

wolf27w commented Aug 7, 2023

使用定义中docker部署方式,配置好没有结果,但是代码里的需要一个mongodb,使用docker的时候没有说需要创建mongodb呀,而且dockerfile里https://sec.ly.com/mirror/mongodb-linux-x86_64-3.4.0.tgz这个提示是502

@medasz
Copy link

medasz commented Apr 24, 2024

我修改了Dockerfile文件:

FROM ubuntu:14.04
MAINTAINER [email protected]
ENV LC_ALL C.UTF-8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# apt and pip mirrors

# RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list \
#     && mkdir -p ~/.pip \
#     && echo "[global]" > ~/.pip/pip.conf \
#     && echo "timeout=60" >> ~/.pip/pip.conf \
#     && echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf

# install requirements

RUN set -x \
    && echo '' >/etc/apt/sources.list \
    && echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse\n\
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse\n\
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse\n'>/etc/apt/sources.list \
    && apt-get clean \
    && apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y wget unzip gcc libssl-dev libffi-dev python-dev libpcap-dev python python-setuptools curl \
    && curl 'https://bootstrap.pypa.io/pip/2.7/get-pip.py' > get-pip.py \
    && sudo python get-pip.py \
    && sudo easy_install pip

# install mongodb

#ENV MONGODB_TGZ https://sec.ly.com/mirror/mongodb-linux-x86_64-3.4.0.tgz
RUN set -x \
    && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D68FA50FEA312927 \
    && echo "deb https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse\n" >> /etc/apt/sources.list \
    && apt-get update \
    && apt-get install mongodb-org -y

#ENV PATH /opt/mongodb/bin:$PATH

# install xunfeng
RUN mkdir -p /opt/xunfeng
COPY . /opt/xunfeng

RUN set -x \
    && pip install -r /opt/xunfeng/requirements.txt \
    && ln -s /usr/lib/x86_64-linux-gnu/libpcap.so /usr/lib/x86_64-linux-gnu/libpcap.so.1

RUN set -x \
    && chmod a+x /opt/xunfeng/masscan/linux_64/masscan \
    && chmod a+x /opt/xunfeng/dockerconf/start.sh

WORKDIR /opt/xunfeng

VOLUME ["/data"]

ENTRYPOINT ["/opt/xunfeng/dockerconf/start.sh"]

EXPOSE 80

CMD ["/usr/bin/tail", "-f", "/dev/null"]

@wolf27w
Copy link
Author

wolf27w commented Apr 26, 2024

感谢

@medasz
Copy link

medasz commented Apr 26, 2024

我把镜像传到了docker hub:medasz/xunfeng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants