Skip to content

Commit 8a3d3b7

Browse files
author
余亮华
committed
添加 初始版本
0 parents  commit 8a3d3b7

File tree

3 files changed

+217
-0
lines changed

3 files changed

+217
-0
lines changed

Dockerfile_ubuntu_small_amd64

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 基础镜像: alg_base_ubuntu_samll_amd64:1.0.0
2+
# ubuntu 20
3+
# Package Version
4+
# ------------------------------ ---------
5+
# certifi 2021.10.8
6+
# charset-normalizer 2.0.7
7+
# GDAL 3.3.0
8+
# idna 3.3
9+
# numpy 1.21.2
10+
# opencv-contrib-python-headless 4.5.3.56
11+
# pip 20.0.2
12+
# PyYAML 5.4.1
13+
# requests 2.26.0
14+
# setuptools 45.2.0
15+
# urllib3 1.26.7
16+
# wheel 0.34.2
17+
18+
FROM osgeo/gdal:ubuntu-small-latest-amd64
19+
ENV is_prod_env=True
20+
21+
RUN mkdir -p /app \
22+
&& mkdir -p /data_mining/data \
23+
&& mkdir -p /data_mining/result \
24+
&& mkdir -p /data_mining/logs \
25+
&& mkdir -p /data_mining/shp \
26+
&& mkdir -p /data_mining/model \
27+
&& sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
28+
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
29+
&& apt-get update \
30+
&& sh -c '/bin/echo -e "Y\n" | apt-get install python3-pip' \
31+
&& sh -c '/bin/echo -e "Y\n" | apt-get install libgl1-mesa-glx' \
32+
&& pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir opencv-contrib-python-headless==4.5.3.56 requests==2.26.0 PyYAML==5.4.1 \
33+
&& pip3 install --upgrade -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir numpy==1.21.2 \
34+
&& apt-get clean && apt-get autoclean

Dockerfile_ubuntu_small_amd64_gpu

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# 基础镜像: alg_base_ubuntu_samll_amd64_gpu:1.0.0
2+
# ubuntu 20
3+
# Package Version
4+
# ------------------------------ ---------
5+
# absl-py 0.15.0
6+
# astunparse 1.6.3
7+
# cachetools 4.2.4
8+
# certifi 2021.10.8
9+
# charset-normalizer 2.0.7
10+
# clang 5.0
11+
# flatbuffers 1.12
12+
# gast 0.4.0
13+
# GDAL 3.3.0
14+
# google-auth 2.3.0
15+
# google-auth-oauthlib 0.4.6
16+
# google-pasta 0.2.0
17+
# grpcio 1.41.0
18+
# h5py 3.1.0
19+
# idna 3.3
20+
# keras 2.6.0
21+
# Keras-Preprocessing 1.1.2
22+
# Markdown 3.3.4
23+
# numpy 1.19.5
24+
# oauthlib 3.1.1
25+
# opencv-contrib-python-headless 4.5.3.56
26+
# opt-einsum 3.3.0
27+
# pip 20.0.2
28+
# protobuf 3.18.1
29+
# pyasn1 0.4.8
30+
# pyasn1-modules 0.2.8
31+
# PyYAML 5.4.1
32+
# requests 2.26.0
33+
# requests-oauthlib 1.3.0
34+
# rsa 4.7.2
35+
# setuptools 45.2.0
36+
# six 1.15.0
37+
# tensorboard 2.7.0
38+
# tensorboard-data-server 0.6.1
39+
# tensorboard-plugin-wit 1.8.0
40+
# tensorflow-estimator 2.6.0
41+
# tensorflow-gpu 2.6.0
42+
# termcolor 1.1.0
43+
# typing-extensions 3.7.4.3
44+
# urllib3 1.26.7
45+
# Werkzeug 2.0.2
46+
# wheel 0.37.0
47+
# wrapt 1.12.1
48+
49+
FROM osgeo/gdal:ubuntu-small-latest-amd64
50+
ENV is_prod_env=True
51+
52+
RUN mkdir -p /app \
53+
&& mkdir -p /data_mining/data \
54+
&& mkdir -p /data_mining/result \
55+
&& mkdir -p /data_mining/logs \
56+
&& mkdir -p /data_mining/shp \
57+
&& mkdir -p /data_mining/model \
58+
&& sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
59+
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
60+
&& apt-get update \
61+
&& sh -c '/bin/echo -e "Y\n" | apt-get install python3-pip' \
62+
&& sh -c '/bin/echo -e "Y\n" | apt-get install libgl1-mesa-glx' \
63+
&& pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir opencv-contrib-python-headless==4.5.3.56 requests==2.26.0 PyYAML==5.4.1 \
64+
&& pip3 install --upgrade -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir numpy==1.21.2 \
65+
&& curl -o /tmp/libcudart11.0_11.3.109~11.3.1-4_amd64.deb http://mirrors.ustc.edu.cn/ubuntu/pool/multiverse/n/nvidia-cuda-toolkit/libcudart11.0_11.3.109~11.3.1-4_amd64.deb \
66+
&& dpkg -i /tmp/libcudart11.0_11.3.109~11.3.1-4_amd64.deb \
67+
&& pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir tensorflow-gpu \
68+
&& pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir Keras \
69+
&& apt-get clean && apt-get autoclean

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# docker-python-data-science
2+
3+
## 基础镜像说明
4+
5+
基于gdal官方的`ubuntu-small-latest-amd64`镜像制作模型基础镜像,在此镜像的基础上安装其它py包,形成以下两个模型基础镜像:
6+
7+
* Dockerfile_ubuntu_small_amd64
8+
* Dockerfile_ubuntu_small_amd64_gpu 附带了tensorflow、keras及cuda驱动
9+
10+
使用以上两个镜像可方便自定义Dockerfile,来构建自己的项目和产品。
11+
12+
## py 和 gcc 版本
13+
14+
Python 3.8.10 (default, Jun 2 2021, 10:49:15)
15+
[GCC 9.4.0] on linux
16+
17+
## Dockerfile_ubuntu_small_amd64
18+
19+
包含以下组件:
20+
21+
```bash
22+
# ubuntu 20
23+
# Package Version
24+
# ------------------------------ ---------
25+
# certifi 2021.10.8
26+
# charset-normalizer 2.0.7
27+
# GDAL 3.3.0
28+
# idna 3.3
29+
# numpy 1.21.2
30+
# opencv-contrib-python-headless 4.5.3.56
31+
# pip 20.0.2
32+
# PyYAML 5.4.1
33+
# requests 2.26.0
34+
# setuptools 45.2.0
35+
# urllib3 1.26.7
36+
# wheel 0.34.2
37+
```
38+
39+
40+
## Dockerfile_ubuntu_small_amd64_gpu
41+
42+
包含以下组件:
43+
44+
```bash
45+
# ubuntu 20
46+
# Package Version
47+
# ------------------------------ ---------
48+
# absl-py 0.15.0
49+
# astunparse 1.6.3
50+
# cachetools 4.2.4
51+
# certifi 2021.10.8
52+
# charset-normalizer 2.0.7
53+
# clang 5.0
54+
# flatbuffers 1.12
55+
# gast 0.4.0
56+
# GDAL 3.3.0
57+
# google-auth 2.3.0
58+
# google-auth-oauthlib 0.4.6
59+
# google-pasta 0.2.0
60+
# grpcio 1.41.0
61+
# h5py 3.1.0
62+
# idna 3.3
63+
# keras 2.6.0
64+
# Keras-Preprocessing 1.1.2
65+
# Markdown 3.3.4
66+
# numpy 1.19.5
67+
# oauthlib 3.1.1
68+
# opencv-contrib-python-headless 4.5.3.56
69+
# opt-einsum 3.3.0
70+
# pip 20.0.2
71+
# protobuf 3.18.1
72+
# pyasn1 0.4.8
73+
# pyasn1-modules 0.2.8
74+
# PyYAML 5.4.1
75+
# requests 2.26.0
76+
# requests-oauthlib 1.3.0
77+
# rsa 4.7.2
78+
# setuptools 45.2.0
79+
# six 1.15.0
80+
# tensorboard 2.7.0
81+
# tensorboard-data-server 0.6.1
82+
# tensorboard-plugin-wit 1.8.0
83+
# tensorflow-estimator 2.6.0
84+
# tensorflow-gpu 2.6.0
85+
# termcolor 1.1.0
86+
# typing-extensions 3.7.4.3
87+
# urllib3 1.26.7
88+
# Werkzeug 2.0.2
89+
# wheel 0.37.0
90+
# wrapt 1.12.1
91+
```
92+
93+
## 自定义Dockerfile
94+
95+
```dockerfile
96+
FROM alg_base_ubuntu_samll_amd64:1.0.0
97+
# or
98+
#FROM alg_base_ubuntu_samll_amd64_gpu:1.0.0
99+
100+
101+
WORKDIR /app
102+
103+
ADD ./config.json /app/
104+
ADD ./*.py /app/
105+
ADD ./*.yml /app/
106+
ADD ./requirements.txt /app/
107+
108+
RUN apt-get update \
109+
&& sh -c '/bin/echo -e "Y\n" | apt-get install libxml2 libxml2-dev libxslt1.1 libxslt1-dev' \
110+
&& pip3 install -i https://pypi.mirrors.ustc.edu.cn/simple/ --no-cache-dir -r requirements.txt \
111+
&& apt-get clean && apt-get autoclean
112+
113+
CMD ["python3", "/app/your.py"]
114+
```

0 commit comments

Comments
 (0)