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,包括docker镜像 #148

Open
jackadam1981 opened this issue Jun 8, 2018 · 3 comments
Open

提供给大家一个dockerfile,包括docker镜像 #148

jackadam1981 opened this issue Jun 8, 2018 · 3 comments

Comments

@jackadam1981
Copy link

The above version only supports Python 2. If you looking for Python 3 support, try the experimental version.

pip install web.py==0.40-dev1

python3 可以使用0.40-dev1,直接pip安装

提供一个dockerfile,还没传上docker hub

from alpine:3.7
MAINTAINER jackadamjackadam@sina.com
#变更源

安装包源切到中科大, 国内访问加速

RUN {
echo 'http://mirrors.ustc.edu.cn/alpine/v3.7/main';
echo 'http://mirrors.ustc.edu.cn/alpine/v3.7/community';
echo 'http://mirrors.ustc.edu.cn/alpine/edge/main';
echo 'http://mirrors.ustc.edu.cn/alpine/edge/community';
echo 'http://mirrors.ustc.edu.cn/alpine/edge/testing';
} > /etc/apk/repositories && \

设置默认时区为亚洲/上海 (没有北京可选)

apk add --no-cache --upgrade apk-tools tzdata&& \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata 

EXPOSE 8000

#这里增加python3
RUN apk add --no-cache --upgrade git python3 python3-dev gcc musl-dev==1.1.19-r8 libxslt-dev linux-headers &&
pip3 install --upgrade pip requests chardet sqlalchemy utils psutil lxml web.py==0.40-dev1 gevent

#克隆代理池源码
RUN git clone https://github.com/qiyeboy/IPProxyPool.git

#启动代理池
CMD python3 /IPProxyPool/IPProxy.py

配套启动脚本:

echo 停止容器
docker stop Iproxypool
echo 删除容器
docker rm Iproxypool
echo 临时禁用selinux
setenforce 0
echo 重建镜像
docker build -t ipproxypool .
echo 恢复启用selinux
setenforce 1
echo 启动容器
docker run -d -t --restart=always --privileged --name Iproxypool -p 8000:8000 ipproxypool

@jackadam1981
Copy link
Author

jackadam1981 commented Jun 8, 2018

无脑使用版本。
docker run -d -t --restart=always --privileged --name Iproxypool -p 8000:8000 jackadam/ipproxypool
安装docker,然后运行这一句就可以了。
已经传上docker hub了。
然后访问 http://ip:8000

@jackadam1981
Copy link
Author

jackadam1981 commented Jun 8, 2018

from alpine:3.7
MAINTAINER jackadamjackadam@sina.com

RUN apk add --no-cache --upgrade apk-tools tzdata &&
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&
echo "Asia/Shanghai" > /etc/timezone &&
apk del tzdata

EXPOSE 8000

#这里安装python3,各种依赖
RUN apk add --no-cache --upgrade git python3 python3-dev gcc musl-dev==1.1.18-r3 libxslt-dev linux-headers &&
pip3 install --upgrade pip requests chardet sqlalchemy utils psutil lxml web.py==0.40-dev1 gevent

#克隆代理池源码
RUN git clone https://github.com/qiyeboy/IPProxyPool.git

#启动代理池
CMD python3 /IPProxyPool/IPProxy.py

@jackadam1981 jackadam1981 changed the title 提供给大家一个dockerfile,等dockerhub生成以后,再给大家更详细的说明 提供给大家一个dockerfile,包括docker镜像 Jun 8, 2018
@NullYing
Copy link

NullYing commented Oct 17, 2018

https://hub.docker.com/r/cz5424/ipproxypool/~/dockerfile/

py2版本,综合大家的各种版本汇总的

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