如何解决docker-compose build:重试步骤以防失败x次?
由于我们公司的部分互联网状况不佳,我们在不断构建容器方面遇到了问题。假设我们有一个php-fpm容器,该容器需要大量其他软件,并具有大约60个构建步骤。
现在,当执行docker-compose build --no-cache php-fpm
时,例如做apt-get update
或安装某个库。
输出如下:
Step 29/56 : RUN apt-get update && apt-get -y --no-install-recommends install wkhtmltopdf
---> Running in 7ec583e71349
[...]
Err:1 http://deb.debian.org/debian buster/main amd64 libdouble-conversion1 amd64 3.1.0-3
Could not resolve 'deb.debian.org'
Err:2 http://deb.debian.org/debian buster/main amd64 libpcre2-16-0 amd64 10.32-5
Could not resolve 'deb.debian.org'
[.....]
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c apt-get update && apt-get -y --no-install-recommends install wkhtmltopdf' returned a non-zero code: 100
所以我想知道是否有可能在退出构建过程之前让docker尝试尝试某步甚至某些步骤,例如3次?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com(将#修改为@)