boot2docker / boot2docker

DEPRECATED; see https://github.com/boot2docker/boot2docker/pull/1408
https://github.com/boot2docker/boot2docker/pull/1408
Apache License 2.0
8.33k stars 1.29k forks source link

network transmission broke the file. #996

Closed vr-devil closed 7 years ago

vr-devil commented 9 years ago

I build up a website on boot2docker, when I access it through a browser, the returned file(css & js) is broken. this problem happened on both Windows and OS X.

I try to build up website on OS X directly, not on boot2docker, everything is okay. the returned file is not broken.

The case is that, when i first started boot2docker, and access the website, the returned css file is normal, but when i make changes to file(e.g. append some content to file), then access website again, the returned css file is broken, file shows messy code on the browser.

I use command ‘hexdump -C test.css’ to check original file and broken file, the tail part of file bytes is different.

original file(test.css, encoding is utf-8):

.a{}
.b{}

original file(hex format):

00000000  2e 61 20 7b 7d 0a 2e 62  20 7b 7d                 |.a {}..b {}|
0000000b

broken file(hex format):

00000000  2e 61 20 7b 0a 0a 7d 00  00 00 00                 |.a {..}....|
0000000b

My environment:

docker-compose.yml

wwwdata:
    image: busybox
    volumes:
        - /Users/Kai/Workspace/www:/var/www

mysqldata:
    image: busybox
    volumes:
        - /var/lib/mysql

mysql:
    image: "mysql:5.6.25"
    volumes_from:
        - mysqldata
    ports:
        - "3306:3306"
    environment:
        - MYSQL_ROOT_PASSWORD=xxxxxxxxx

fpm:
    build: builds/php
    links:
        - mysql
    volumes_from:
        - wwwdata

nginx:
    image: "nginx:1.9.2"
    links:
        - fpm
    volumes:
        - /Users/Kai/Workspace/docker/lnmp/nginx:/etc/nginx
    volumes_from:
        - wwwdata
    ports:
        - "80:80"
        - "443:443"
yeliu84 commented 9 years ago

I have the same issue, have you found any solution?

yeliu84 commented 9 years ago

Removing sendfile on from my nginx.conf solved this issue. https://github.com/boot2docker/osx-installer/issues/100

vr-devil commented 9 years ago

@jaux Thanks~~~

yosifkit commented 7 years ago

Closing as this seems to be resolved. If you feel this issue was closed prematurely, please comment and let us know.