Docker Hub Mirroring Build Error: returned a Non-zero code:8

Source: Internet
Author: User
Tags docker hub
For the same Dockerfile,docker hub to build at different times there will be different results, as in the following building Tomcat Image: # based on CENTOS6 base mirroring from Centos:6 maintainer Chenyufeng " Yufengcode@gmail.com "
# Set the current tool directory # This command does not add a mirrored layer Workdir/home
# Install the necessary tools RUN Yum install-y wget && \     rpm--rebuilddb && \    &NB Sp;yum install-y tar && \     wget--no-check-certificate--no-cookies--header "Cookie:ora Clelicense=accept-securebackup-cookie "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/ d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz && \     tar-xvzf jdk-8u131-linux-x64.tar.gz && \     wget http://mirrors.tuna.tsinghua.edu.cn/apache/ tomcat/tomcat-8/v8.0.48/bin/apache-tomcat-8.0.48.tar.gz && \     tar-xvzf apache-tomcat-8.0.48.tar.gz && \     mv apache-tomcat-8.0.48/tomcat && \  & Nbsp;  rm-f jdk-8u131-linux-x64.tar.gz && \     rm-f apache-tomcat-8.0.48.tar.gz && \         ln-snf/usr/share/ zoneinfo/$TZ/etc/localtIME && echo $TZ >/etc/timezone && \     yum Clean All
# SET environment variable env java_home/home/jdk1.8.0_131 env catalina_home/home/tomcat env PATH $PATH: $JAVA _home/bin: $CATALINA _home/ Bin ENV TZ Asia/shanghai
# Exposing Tomcat 8080 port expose 8080
# Launch Container execute the following command entrypoint/home/tomcat/bin/startup.sh && tail-f/home/tomcat/logs/catalina.out
# Create a container to start Tomcat, because the entrypoint priority is higher than CMD, so here's cmd will not execute cmd ["/home/tomcat/bin/startup.sh"]
The build was successful 3 months ago (about January 2018), but the build failed 2 months ago (month February 2018), during which the mirror file was not modified.
After the build failed, the error is as follows: Built failed:the command '/bin/sh-c yum install-y wget && rpm--rebuilddb && yum install-y Tar && wget--no-check-certificate--no-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/ jdk-8u131-linux-x64.tar.gz && tar-xvzf jdk-8u131-linux-x64.tar.gz && wget http:// mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.0.48/bin/apache-tomcat-8.0.48.tar.gz && Tar-xvzf apache-tomcat-8.0.48.tar.gz && mv Apache-tomcat-8.0.48/tomcat && rm-f jdk-8u131-linux-x64.tar.gz && rm-f apache-tomcat-8.0.48.tar.gz && ln-snf/usr/share/zoneinfo/$TZ/etc/localtime && Echo $T Z >/etc/timezone && yum Clean All ' returned a Non-zero code:8

This is because the Docker hub in fact will also change the source occasionally, may download a package today, but tomorrow may not be downloaded. The problem is the JDK and Tomcat in the mirrored file, and as the months passed, the above JDK and Tomcat versions were older, causing the Docker hub download to fail. So if "returned a Non-zero code:8" is the problem, it is likely that some of the software versions in the mirror file are very old, causing the Docker hub download to fail. So the mirror file is not finished once and for all, but also to be constantly updated. Modifying the above dockerfile can be built as follows: # based on CENTOS6 base mirroring from Centos:6 maintainer Chenyufeng "yufengcode@gmail.com"
# Set the current tool directory # This command does not add a mirrored layer Workdir/home
# Install the necessary tools RUN Yum install-y wget && \     rpm--rebuilddb && \    &NB Sp;yum install-y tar && \     wget--no-check-certificate--no-cookies--header "Cookie:ora Clelicense=accept-securebackup-cookie "http://download.oracle.com/otn-pub/java/jdk/8u162-b12/ 0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz && \     tar-xvzf jdk-8u162-linux-x64.tar.gz && \     wget https://mirrors.tuna.tsinghua.edu.cn/apache/ tomcat/tomcat-8/v8.5.29/bin/apache-tomcat-8.5.29.tar.gz && \     tar-xvzf apache-tomcat-8.5.29.tar.gz && \     mv apache-tomcat-8.5.29/tomcat && \  & Nbsp;  rm-f jdk-8u162-linux-x64.tar.gz && \     rm-f apache-tomcat-8.5.29.tar.gz && \         ln-snf/usr/share/ zoneinfo/$TZ/etc/localTime && echo $TZ >/etc/timezone && \     yum Clean All
# SET environment variable env java_home/home/jdk1.8.0_162 env catalina_home/home/tomcat env PATH $PATH: $JAVA _home/bin: $CATALINA _home/ Bin ENV TZ Asia/shanghai
# Exposing Tomcat 8080 port expose 8080
# Launch Container execute the following command entrypoint/home/tomcat/bin/startup.sh && tail-f/home/tomcat/logs/catalina.out
# Create a container to start Tomcat, because the entrypoint priority is higher than CMD, so here's cmd will not execute cmd ["/home/tomcat/bin/startup.sh"]
That is, the JDK and Tomcat are raised to the latest updates under the current version. Also note that the build is done after each dockerfile modification, not only to build the latest version, but also to build a version that specifies the specific version number 1.*. That is, you must have version control and release of the Mirror itself. The results of the Docker Hub's automatic construction of the above mirrors are as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.