Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker for Windows : corrupted files

This post is about an issue that I am having using webpack and Vue.js and the stable version of Docker for Windows.

It seems that large compiled files ( more than 1 Mb ) are splitted into chunks when sent over from the Virtual Machine, and it turns out that 90% of the time they end up corrupted ( parts of other files seems to get injected in between files chunks ).

I came across a few reported bugs that are happening on both Windows and MacOS, it seems that these similar issues gets solved by changing Apache configuration to sendfile Off AND/OR MMAP Off inside the Dockerfile :

RUN sed -i -e 's/EnableSendfile On\/EnableSendfile Off/g' /etc/apache2/httpd.conf

RUN sed -i -e 's/EnableMMAP On\/EnableMMAP Off/g' /etc/apache2/httpd.conf

This did not fix anything for me..

As you can see, without any code change, after each hard-refresh, these are the errors that come up, every time at a different line, because of corrupted file outputs:

Various outputs based on corruptied chunks

Does anyone in the community have an idea on why this keeps on happening ?

like image 823
Xavier B. Avatar asked Oct 30 '22 05:10

Xavier B.


1 Answers

In some docker configurations you just need to uncomment the line related to MMAP (SendFile is Off by default).

 sed -i 's|#EnableMMAP off|EnableMMAP off|' /etc/apache2/httpd.conf \

Also you can look at you httpd.conf in your apache container to be sure weither you need to add/uncomment this MMAP option to Off

like image 188
STcoding Avatar answered Nov 15 '22 05:11

STcoding