【Docker】部署时遇到的一些问题

问题:Hash sum mismatch

解决方案:

解决参考:Docker学习笔记(五)-fixbug2-Hash sum mismatch

 

问题:Dockerfile: “RUN apt-get install” all packages at once or one by one?

https://forums.docker.com/t/dockerfile-run-apt-get-install-all-packages-at-once-or-one-by-one/17191

So for example:

RUN apt-get update && apt-get install -y \
    python-qt4 \
    python-pyside \
    python-pip \
    python3-pip \
    python3-pyqt5

…versus:

RUN apt-get update
RUN apt-get install -y python-qt4
RUN apt-get install -y python-pyside
RUN apt-get install -y python-pip
RUN apt-get install -y python3-pip
RUN apt-get install -y python3-pyqt5

回答

Multiple RUN apt-get install lines create many extra layers (not necessarily harmful but there’s a limit), prevents you from effectively cleaning up the intermediate *.deb files and package lists, and will take longer to build since APT has a non-trivial startup time.

The only time I’d suggest separate RUN apt-get install lines is if you’re not totally sure what run-time dependencies your application has and you’re frequently editing the list of packages in the course of development. In that case, if you add another RUN line at the end of the list, the standard docker build caching will skip over all of the previous ones and save you some download/unpack time. But once you’ve gotten it working I’d fold it into a single command.

 

 

其他一些网路问题

 

问题:No server is available to handle this request.

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值