分镜像构建
因为问题太多了,不能每次出错都从头开始,所以分多个dockerfile构建
注意两点:
- 修改dockerfile中FROM
- docker bulid时的文件名和版本号(且cd到dockerfile所在路径下)
F:\step>docker build -f F:\step\s5 -t s:1.6 .
问题1 RUN apt-get update 一直报错
详情见:
https://blog.csdn.net/weixin_47343723/article/details/124592797?spm=1001.2014.3001.5501
问题2 apt-get install -y时不时报错
修改sources.list文件,前面应该已经安装了vim命令,可以vim直接修改,
或者用我的笨办法详情见:
https://blog.csdn.net/weixin_47343723/article/details/124592797?spm=1001.2014.3001.5501
加入如下源:(此处尝试了很多源,只有加入下面地址才真的全部成功了)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
链接:https://pan.baidu.com/s/1n-Un04k0Y6SYwbML8jWtOw
提取码:z2qi
放个文件链接吧,万一真的有用呢
问题3 pip install 安装过程慢
Dockerfile中pip install前加入
RUN pip config set global.trusted-host mirrors.aliyun.com
RUN pip config set global.index-url https://mirrors.aliyun.com/simple
RUN pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
问题4 pip install -U 'git+https:XXX"报错
因为外网缘故吧,进入网站https://github.com/facebookresearch/fvcore,换别的下载方式,我选了下面这种。
使用
RUN git clone https://github.com/facebookresearch/fvcore
RUN pip install -e fvcore
替换
RUN pip install -U 'git+https://github.com/facebookresearch/fvcore'
问题5 WORKDIR ${WORKSPACE} cannot normalize nothing
直接去掉这行,我查了很多地方,也没懂这个错误怎么产生的,我理解的就是环境变量workspace本身就什么都没有,所以没办法指定工作目录。大不了在运行的时候再指定呗,应该无伤大雅吧
————————————————————分割线———————————————————————
以上,就是构建镜像出现的错误,但只是构建镜像成功,还没有跑代码测试过,实时更新中…哪里不对,欢迎指正,如果有dd3d代码运行成功的,或者3D检测其他代码运行成功的,非常希望与您加QQ交流~~