在本地pip可以成功,但是用docker build失败,
报错信息如下:

[+] Building 650.8s (10/12)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 850B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for docker.io/tensorflow/tensorflow:1.14.0-gpu-py3 1.3s
=> [internal] load build context 0.0s
=> => transferring context: 6.34kB 0.0s
=> [1/8] FROM docker.io/tensorflow/tensorflow:1.14.0-gpu-py3@sha256:e72e66b3dcb9c9e8f4e5703965ae1466b23fe8cad59e1c92c6e9fa58f8d81dc8 0.0s
=> CACHED [2/8] RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 0.0s
=> CACHED [3/8] RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list && sed -i s/security.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.li 0.0s
=> CACHED [4/8] RUN pip install -i https://mirrors.aliyun.com/pypi/simple --upgrade pip 0.0s
=> CACHED [5/8] COPY requirements.txt /opt/app/requirements.txt 0.0s
=> ERROR [6/8] RUN pip install -i https://mirrors.aliyun.com/pypi/simple -r /opt/app/requirements.txt 649.3s

[6/8] RUN pip install -i https://mirrors.aliyun.com/pypi/simple -r /opt/app/requirements.txt:
#10 0.744 Looking in indexes: https://mirrors.aliyun.com/pypi/simple
#10 1.097 Collecting oss22.9.1
#10 1.242 Downloading https://mirrors.aliyun.com/pypi/packages/d2/48/eb57178164aa2ec0bf3a19b95b297c9d34c18307ccc23e217e881767a57a/oss2-2.9.1.tar.gz (186 kB)
#10 2.490 Collecting cython
0.29.14
#10 2.527 Downloading https://mirrors.aliyun.com/pypi/packages/df/d1/4d3f8a7a920e805488a966cc6ab55c978a712240f584445d703c08b9f405/Cython-0.29.14-cp36-cp36m-manylinux1_x86_64.whl (2.1 MB)
#10 3.700 Requirement already satisfied: h5py2.9.0 in /usr/local/lib/python3.6/dist-packages (from -r /opt/app/requirements.txt (line 3)) (2.9.0)
#10 3.955 Collecting scikit-image
0.14.5
#10 3.984 Downloading https://mirrors.aliyun.com/pypi/packages/27/78/cfb15cdb3f63eea16946a42d0dbf7ef17be79d30858aa8efd5f6757bd106/scikit_image-0.14.5-cp36-cp36m-manylinux1_x86_64.whl (25.4 MB)
#10 18.65 Collecting scikit-learn0.23.1
#10 18.69 Downloading https://mirrors.aliyun.com/pypi/packages/d9/3a/eb8d7bbe28f4787d140bb9df685b7d5bf6115c0e2a969def4027144e98b6/scikit_learn-0.23.1-cp36-cp36m-manylinux1_x86_64.whl (6.8 MB)
#10 22.53 Requirement already satisfied: keras-applications
1.0.8 in /usr/local/lib/python3.6/dist-packages (from -r /opt/app/requirements.txt (line 6)) (1.0.8)
#10 22.69 Collecting keras-retinanet0.5.1
#10 22.82 Downloading https://mirrors.aliyun.com/pypi/packages/20/ca/63f77949493c63eebf982bc1edb0b54d849b6d709a724328ea5682e6b40e/keras-retinanet-0.5.1.tar.gz (61 kB)
#10 54.62 Collecting keras
2.3.1
#10 54.78 Downloading https://mirrors.aliyun.com/pypi/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl (377 kB)
#10 55.25 Collecting keras-efficientnets0.1.7
#10 55.40 Downloading https://mirrors.aliyun.com/pypi/packages/3a/41/4dce4e88042b4934003b2b51cfb6a99fc446d375d5fc1ffb2fdf8e069d36/keras_efficientnets-0.1.7-py2.py3-none-any.whl (15 kB)
#10 56.19 Collecting pillow
6.2.1
#10 56.43 Downloading https://mirrors.aliyun.com/pypi/packages/10/5c/0e94e689de2476c4c5e644a3bd223a1c1b9e2bdb7c510191750be74fa786/Pillow-6.2.1-cp36-cp36m-manylinux1_x86_64.whl (2.1 MB)
#10 57.88 Collecting progressbar23.47.0
#10 58.25 Downloading https://mirrors.aliyun.com/pypi/packages/16/68/adc395e0a3c86571081c8a2e2daaa5b58270f6854276a089a0e9b5fa2c33/progressbar2-3.47.0-py2.py3-none-any.whl (24 kB)
#10 58.69 Collecting matplotlib
3.1.1
#10 58.85 Downloading https://mirrors.aliyun.com/pypi/packages/57/4f/dd381ecf6c6ab9bcdaa8ea912e866dedc6e696756156d8ecc087e20817e2/matplotlib-3.1.1-cp36-cp36m-manylinux1_x86_64.whl (13.1 MB)
#10 66.84 Collecting lxml4.4.2
#10 67.04 Downloading https://mirrors.aliyun.com/pypi/packages/68/30/affd16b77edf9537f5be051905f33527021e20d563d013e8c42c7fd01949/lxml-4.4.2-cp36-cp36m-manylinux1_x86_64.whl (5.8 MB)
#10 70.83 Collecting jupyterlab
1.2.4
#10 71.39 Downloading https://mirrors.aliyun.com/pypi/packages/35/9a/6e81535ed42ad01ec2a5e8f9e0419108f60fab36e48dc1168fa5e0576a81/jupyterlab-1.2.4-py2.py3-none-any.whl (6.4 MB)
#10 75.16 Collecting shapely1.6.4.post2
#10 75.34 Downloading https://mirrors.aliyun.com/pypi/packages/38/b6/b53f19062afd49bb5abd049aeed36f13bf8d57ef8f3fa07a5203531a0252/Shapely-1.6.4.post2-cp36-cp36m-manylinux1_x86_64.whl (1.5 MB)
#10 76.40 Collecting jupyter-tensorboard
0.1.10
#10 76.62 Downloading https://mirrors.aliyun.com/pypi/packages/46/36/87935f2abaab692dfd5dc5ec335edd2bbed6ac614b35875852ee2173f9f3/jupyter_tensorboard-0.1.10.tar.gz (15 kB)
#10 77.35 Collecting opencv-contrib-python3.4.2.17
#10 77.62 Downloading https://mirrors.aliyun.com/pypi/packages/61/29/fc60b2de1713aa92946992544329f20ccb5e4ba26290f403e04b7da44105/opencv_contrib_python-3.4.2.17-cp36-cp36m-manylinux1_x86_64.whl (30.6 MB)
#10 95.03 Collecting jupyterlab_code_formatter
1.0.3
#10 95.18 Downloading https://mirrors.aliyun.com/pypi/packages/21/61/7db08d1b9f62b14ae170c5893ef067e795d49033de7df59cc745ab68340c/jupyterlab_code_formatter-1.0.3-py3-none-any.whl (5.7 kB)
#10 95.52 Collecting pre-commit1.21.0
#10 95.67 Downloading https://mirrors.aliyun.com/pypi/packages/df/30/22425aa6680370ba06de107e82eb3fc6159f462619b941241e96dd6bd79b/pre_commit-1.21.0-py2.py3-none-any.whl (166 kB)
#10 96.00 Collecting tqdm
4.27.0
#10 96.15 Downloading https://mirrors.aliyun.com/pypi/packages/16/33/6d8bd6a7c4238f383426b7593bf05bfd6d9e1f10c3084b56c0f14d973754/tqdm-4.27.0-py2.py3-none-any.whl (44 kB)
#10 96.44 Collecting pytest5.3.2
#10 96.59 Downloading https://mirrors.aliyun.com/pypi/packages/19/cf/711f1d887cb92c5155c9a1eb338f1b5d2411b50e4492a3b20e4a188a22b2/pytest-5.3.2-py3-none-any.whl (234 kB)
#10 96.94 Collecting pytest-black
0.3.7
#10 97.08 Downloading https://mirrors.aliyun.com/pypi/packages/5a/da/f23c7c8cd5d4fccd919980ed7c702f5bfca43808d1d2be83d2e788b8a772/pytest-black-0.3.7.tar.gz (6.3 kB)
#10 99.99 Collecting validators0.14.1
#10 100.2 Downloading https://mirrors.aliyun.com/pypi/packages/72/8a/f99287daae8cfef938e6eec785f6e259bf6bad93269d5398bb546d5b1563/validators-0.14.1.tar.gz (25 kB)
#10 100.7 Collecting imgaug
0.4.0
#10 100.9 Downloading https://mirrors.aliyun.com/pypi/packages/66/b1/af3142c4a85cba6da9f4ebb5ff4e21e2616309552caca5e8acefe9840622/imgaug-0.4.0-py2.py3-none-any.whl (948 kB)
#10 101.7 Collecting tensorlayer
#10 101.9 Downloading https://mirrors.aliyun.com/pypi/packages/d7/7c/d0b4ee62dbc0f08358b7aa7aaeb38d8155ea57eecf1427ee7d13e03c28bc/tensorlayer-2.2.3-py3-none-any.whl (363 kB)
#10 102.4 Collecting black
#10 102.6 Downloading https://mirrors.aliyun.com/pypi/packages/dc/7b/5a6bbe89de849f28d7c109f5ea87b65afa5124ad615f3419e71beb29dc96/black-20.8b1.tar.gz (1.1 MB)
#10 103.5 Installing build dependencies: started
#10 107.5 Installing build dependencies: finished with status ‘done’
#10 107.5 Getting requirements to build wheel: started
#10 107.7 Getting requirements to build wheel: finished with status ‘done’
#10 107.7 Preparing wheel metadata: started
#10 108.0 Preparing wheel metadata: finished with status ‘done’
#10 108.2 Collecting Flask1.1.1
#10 108.4 Downloading https://mirrors.aliyun.com/pypi/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl (94 kB)
#10 108.8 Collecting Flask-Cors
3.0.8
#10 109.0 Downloading https://mirrors.aliyun.com/pypi/packages/78/38/e68b11daa5d613e3a91e4bf3da76c94ac9ee0d9cd515af9c1ab80d36f709/Flask_Cors-3.0.8-py2.py3-none-any.whl (14 kB)
#10 109.6 Collecting gevent1.4.0
#10 109.8 Downloading https://mirrors.aliyun.com/pypi/packages/f2/ca/5b5962361ed832847b6b2f9a2d0452c8c2f29a93baef850bb8ad067c7bf9/gevent-1.4.0-cp36-cp36m-manylinux1_x86_64.whl (5.5 MB)
#10 113.1 Collecting wget
#10 113.3 Downloading https://mirrors.aliyun.com/pypi/packages/47/6a/62e288da7bcda82b935ff0c6cfe542970f04e29c756b0e147251b2fb251f/wget-3.2.zip (10 kB)
#10 113.7 Collecting loguru
#10 113.7 Downloading https://mirrors.aliyun.com/pypi/packages/6d/48/0a7d5847e3de329f1d0134baf707b689700b53bd3066a5a8cfd94b3c9fc8/loguru-0.5.3-py3-none-any.whl (57 kB)
#10 113.9 Collecting xlrd
#10 114.0 Downloading https://mirrors.aliyun.com/pypi/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl (96 kB)
#10 114.6 Collecting pandas
0.23.3
#10 114.8 Downloading https://mirrors.aliyun.com/pypi/packages/f4/cb/a801eaf624e36fffaa6cf1f4597a1e4b0742c200ed928e689c58fb3cb811/pandas-0.23.3-cp36-cp36m-manylinux1_x86_64.whl (8.9 MB)
#10 120.1 Collecting lmdb0.98
#10 120.4 Downloading https://mirrors.aliyun.com/pypi/packages/c0/5c/d56dbc2532ecf14fa004c543927500c0f645eaca8bd7ec39420c7546396a/lmdb-0.98.tar.gz (869 kB)
#10 121.4 Collecting natsort
7.0.1
#10 121.6 Downloading https://mirrors.aliyun.com/pypi/packages/0f/65/81883897f4aaa1e53deaa65137318cfe80b36ce013c2e86f8fd0843cfa02/natsort-7.0.1-py3-none-any.whl (33 kB)
#10 122.3 Collecting boto31.12.39
#10 122.5 Downloading https://mirrors.aliyun.com/pypi/packages/27/87/de75e5a24584d82cca60b86f95d06e56412ed9e23807dcf23896f206f58e/boto3-1.12.39-py2.py3-none-any.whl (128 kB)
#10 122.9 Collecting azure-storage-blob
12.2.0
#10 123.0 Downloading https://mirrors.aliyun.com/pypi/packages/8c/69/38ff4ef3504235601084b0cbedd00be4eb182a70bc3cdf30b3f9b82ec672/azure_storage_blob-12.2.0-py2.py3-none-any.whl (279 kB)
#10 123.4 Collecting esdk-obs-python3.19.11
#10 123.6 Downloading https://mirrors.aliyun.com/pypi/packages/0d/39/070b5842104e274d83dc486b15db41036aff312de5d401b65586f7afa541/esdk-obs-python-3.19.11.tar.gz (58 kB)
#10 124.4 Collecting PyMuPDF
1.17.6
#10 124.6 Downloading https://mirrors.aliyun.com/pypi/packages/cc/e1/b732ba7a4629d03097f0736279a4c8fa3c1c6aab3e827367cb115cdf8731/PyMuPDF-1.17.6-cp36-cp36m-manylinux2010_x86_64.whl (6.0 MB)
#10 128.1 Collecting jieba0.42.1
#10 128.2 Downloading https://mirrors.aliyun.com/pypi/packages/c6/cb/18eeb235f833b726522d7ebed54f2278ce28ba9438e3135ab0278d9792a2/jieba-0.42.1.tar.gz (19.2 MB)
#10 140.0 Collecting joblib
0.16.0
#10 140.2 Downloading https://mirrors.aliyun.com/pypi/packages/51/dd/0e015051b4a27ec5a58b02ab774059f3289a94b0906f880a3f9507e74f38/joblib-0.16.0-py3-none-any.whl (300 kB)
#10 140.6 Collecting xgboost1.1.1
#10 141.5 Downloading https://mirrors.aliyun.com/pypi/packages/7c/32/a11befbb003e0e6b7e062a77f010dfcec0ec3589be537b02d2eb2ff93b9a/xgboost-1.1.1-py3-none-manylinux2010_x86_64.whl (127.6 MB)
#10 214.5 Collecting baidu-aip
2.2.18
#10 214.6 Downloading https://mirrors.aliyun.com/pypi/packages/bf/de/0e770c421bd70b0b59d59d1bcf70139cf0ad4263102a7fc2973c6187174a/baidu-aip-2.2.18.0.tar.gz (10 kB)
#10 215.3 Collecting torch==1.2.0
#10 215.5 Downloading https://mirrors.aliyun.com/pypi/packages/30/57/d5cceb0799c06733eefce80c395459f28970ebb9e896846ce96ab579a3f1/torch-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (748.8 MB)


executor failed running [/bin/bash -c pip install -i https://mirrors.aliyun.com/pypi/simple -r /opt/app/requirements.txt]: exit code: 137

原因:docker内存设置不够。
更改设置:
在这里插入图片描述

成功:
在这里插入图片描述

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐