0
点赞
收藏
分享

微信扫一扫

[问题已处理]-dockerfile报错source - not found

爱动漫建模 2022-03-12 阅读 73

导语:dockerfile在构建镜像的时候报错source: not found ,起因是我想添加环境变量

解决方法1

sh不支持source

bash支持source

# 在dockerfile中添加
RUN /bin/bash -c "source /root/.bashrc"
或者
# 修改sh为bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

解决方法2

通过ENV解决

ENV CUDA_ROOT /usr/local/cuda
举报

相关推荐

0 条评论