Error processing tar file(exit status 1): Unexpected EOF investigation and analysis
1. Build an image in Jenkins and report an error: Error Processing tar file(exit status 1): unexpected EOF. as shown in Figure 1
Step 10/10 : run chown -r nginx:nginx /mcloud/ && chmod 777 /mcloud/cmp_main/data && chmod 777 /usr/share/sync.sh && chmod 777 /mcloud/cmp_main/attachment && chmod +x /config/init/* & chmod +x /etc/nginx/conf.d/* & /etc/supervisord.d/* && rm -rf /mcloud/cmp_main/data/tpl/ & rm -rf /etc/nginx/conf.d/status.conf ---> running in 800972ee06bc Error processing tar file(exit status 1): unexpected EOF Build stepDocker build and publishMarked build as failure Finished: Failure
2. Check the Dockerfile, it should be that the number of the add command is too many, which leads to insufficient space. Reference URL: https://stackoverflow.com/questions/42784396/docker-e rror-error-processing-tar-fileexit-status-1-unexpected-eof . as shown in Figure 2
add code /mcloud/cmp_main add code/build/c_files/ / add code/build/sync.sh /usr/share/sync.sh add code/build/cachejssdk.sh /usr/share/cachejssdk.sh add code/build/mp_verify_3rufnkmvef9eh3mj.txt /mcloud/cmp_main/ add code/build/mp_verify_qximkc3go7fnqbzb.txt/mcloud/cmp_main/ run sed -is/allow_url_fopen = off/allow_url_fopen = on/g/usr/local/php/etc/php.ini && \ sed-is/disable_functions = exec, system/disable_functions = system/g/usr/local/php/etc/php.ini run chown -r nginx:nginx /mcloud/ && \ chmod 777 /mcloud/cmp_main/data && \ chmod 777 /usr/share/sync.sh && \ chmod 777 /mcloud/cmp_main/attachment && \ chmod +x /config/init/* && \ chmod +x /etc/nginx/conf.d/* && \ chmod +x /etc/supervisord.d/* && \ rm -rf /mcloud/cmp_main/data/tpl/ && \ rm -rf /etc/nginx/conf.d/status.conf
3. Cut /build/sync.sh to /build/c_files/usr/share/sync.sh. Cut /build/cachejssdk.sh to /build/c_files/usr/share/cachejssdk.sh. Cut /build/mp_verify_3rufnkmvef9eh3mj.txt to /build/c_files/mcloud/cmp_main/mp_verify_3rufnkmvef9eh3mj.txt. Cut /build/mp_verify_qximkc3go7fnqbzb.txt to /build/c_files/mcloud/cmp_main/mp_verify_qximkc3go7fnqbzb.txt. Edit Dockerfile, deleted 4 lines of add. as shown in Figure 3
run sed -is/allow_url_fopen = off/allow_url_fopen = on/g/usr/local/php/etc/php.ini && \ sed-is/disable_functions = exec, system/disable_functions = system/g/usr/local/php/etc/php.ini add code /mcloud/cmp_main add code/build/c_files/ / run chown -r nginx:nginx /mcloud/ && \ chmod 777 /mcloud/cmp_main/data && \ chmod 777 /usr/share/sync.sh && \ chmod 777 /mcloud/cmp_main/attachment && \ chmod +x /config/init/* && \ chmod +x /etc/nginx/conf.d/* && \ chmod +x /etc/supervisord.d/* && \ rm -rf /mcloud/cmp_main/data/tpl/ && \ rm -rf /etc/nginx/conf.d/status.conf
4. Build again, the first build will report an error: unknown parent image ID sha256:. But the second build was successful. as shown in Figure 4
5. The mirror sizes before and after adjustment are: 4711 and 3882. Size reduced: 4711 – 3882 = 829. as shown in Figure 5
6. Another possible reason is that the Dockerfile has just been greatly modified. In this case, it is recommended to build several times. In the end, it can still be built successfully.




