forked from encodingl/skstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (37 loc) · 1.9 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM centos:7
ENV PATH $PATH:/usr/local/python3/bin/
ENV PYTHONIOENCODING utf-8
WORKDIR /opt/soft/
RUN set -ex \
&& mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup \
&& curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo \
&& sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo \
&& yum makecache \
&& yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make wget ansible gcc-devel python-devel smartmontools mysql-devel libffi-devel git mariadb-server mariadb-devel wget telnet gcc-c++ initscripts tar zip unzip \
&& mkdir /usr/local/python3 \
&& wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz \
&& tar -xvJf Python-3.7.4.tar.xz && rm -f Python-3.7.4.tar.xz \
&& cd Python-3.7.4 \
&& ./configure prefix=/usr/local/python3 \
&& make && make install \
&& cd .. \
&& rm -rf Python-3.7.4 \
&& cd /usr/local/python3 \
&& mv /usr/bin/python /usr/bin/python27 \
&& sed -i "s#/usr/bin/python#/usr/bin/python27#" /usr/bin/yum \
&& sed -i "s#/usr/bin/python#/usr/bin/python27#" /usr/libexec/urlgrabber-ext-down \
&& yum install -y deltarpm \
&& ln -s /usr/local/python3/bin/python3.7 /usr/bin/python \
&& ln -s /usr/local/python3/bin/pip3 /usr/bin/pip \
&& python -m pip install --upgrade pip \
&& yum clean all
RUN set -ex \
&& mkdir /opt/soft/ -p && cd /opt/soft/ \
&& git clone https://github.com/encodingl/skstack.git \
&& cd skstack \
&& pip install --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY ./docker-entrypoint.sh /opt/soft/skstack/
#ENTRYPOINT ["/opt/soft/skstack/docker-entrypoint.sh"]
RUN chmod +x /opt/soft/skstack/docker-entrypoint.sh
EXPOSE 18002
CMD ["/opt/soft/skstack/docker-entrypoint.sh"]