jlesage / docker-firefox

Docker container for Firefox
MIT License
1.4k stars 266 forks source link

Downloading file fails after reaching approximately 250MB #179

Closed dm042023 closed 1 year ago

dm042023 commented 1 year ago

When downloading a file larger than ~250MB the download fails.

jlesage commented 1 year ago

Please provide more details about your setup (the docker run command you used to create the container, compose file, etc).

I was able to download a 1GB file: https://speed.hetzner.de/1GB.bin I created the container with docker run --rm -p 5800:5800 jlesage/firefox

dm042023 commented 1 year ago

Thanks for the quick response!

I’ve tried a few variations.

The default:

docker run -d --name=firefox \ -p 5800:5800 \ -v /docker/appdata/firefox:/config:rw \ jlesage/firefox

This didn’t work for me. The /docker directory is read-only. I’m installing this on a linux based network appliance. OM2200 from opengear.

I created a new directory and ran this as both the root user and a new admin user:

docker run -d --name=firefox \ -p 5800:5800 \ -v /etc/home/admin/firefoxappdata:/config:rw \ jlesage/firefox

I read the instruction about possible problems with the user group and permissions. The last thing I ran was:

docker run -d --name=firefox -e USER_ID=0 -e GROUP_ID=0 -p 5800:5800 -v /etc/home/admin/firefoxappdata:/config:rw jlesage/firefox

root@om2216-l:/etc# id uid=0(root) gid=0(root) groups=0(root),1001(admin)

dm042023 commented 1 year ago

If it helps here is the docker info:

root@om2216-l:/# docker info Client: Debug Mode: false

Server: Containers: 1 Running: 1 Paused: 0 Stopped: 0 Images: 2 Server Version: v19.03.15-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 409c87ba59dd96965239573aa9458a3585c05468.m runc version: 249bca0a1316129dcd5bd38b5d75572274181cb5-dirty init version: b9f42a0-dirty (expected: fec3683b971d9) Kernel Version: 5.10.63-og Operating System: Operations Manager 21.Q3.0 (om) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.825GiB Name: om2216-l ID: ZHBR:MGP3:XX5D:RLKI:TGJ7:XHAY:KEH2:6DRB:N5BK:TMXW:MH6K:K77U Docker Root Dir: /mnt/nvram/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: docker-registry.lighthouse.lhvpn.opengear.com:5005 127.0.0.0/8 Registry Mirrors: http://localhost:5005/ Live Restore Enabled: false

jlesage commented 1 year ago

Just for test purpose, if you don't map anything to /config, does the download work ?

dm042023 commented 1 year ago

Well you've found the problem! I tried without the mapping and it worked. I was able to download the file and copy it from the mount directory. TLDR; I mapped to a directory with more space and worked.

My test file is c1100-universalk9.17.11.01a.SPA.bin

======================== root@om2216-l:/# docker run -d --name=firefox -p 5800:5800 - jlesage/firefox

from docker container inspect

"Mounts": [ { "Type": "volume", "Name": "4ef1851db6069eadbf606c2440b067d8b0a6bc0137bee1b14abb872616950f32", "Source": "/mnt/nvram/docker/volumes/4ef1851db6069eadbf606c2440b067d8b0a6bc0137bee1b14abb872616950f32/_data", "Destination": "/config", "Driver": "local", "Mode": "", "RW": true, "Propagation": "" } ],

file in downloads directory of the tmpfs

root@om2216-l:/mnt/nvram/docker/volumes/4ef1851db6069eadbf606c2440b067d8b0a6bc0137bee1b14abb872616950f32/_data/downloads# ls -la total 669064 drwxr-xr-x 2 1000 1000 4096 Apr 20 01:19 . drwxr-xr-x 7 1000 1000 4096 Apr 20 01:12 .. -rw-r--r-- 1 1000 1000 685106000 Apr 20 01:19 c1100-universalk9.17.11.01a.SPA.bin

That's when I realized I was just being dumb. The home directory of the users on this appliance are linked to the /etc/home directory. /etc/home is only 400MB.

I mapped /config to a /var/tmp/firefoxappdata and it worked like a champ.

home directory link

root@om2216-l:/# ls -la total 3 drwxr-xr-x 17 root root 257 Jan 9 2022 . drwxr-xr-x 17 root root 257 Jan 9 2022 .. drwxr-xr-x 3 root root 2753 Jan 9 2022 bin drwxr-xr-x 5 root root 1024 May 18 2022 boot drwxr-xr-x 17 root root 6740 Apr 19 12:23 dev drwxr-xr-x 1 root root 1024 Apr 18 19:41 etc lrwxrwxrwx 1 root root 9 Jan 9 2022 home -> /etc/home

filesystem sizes

root@om2216-l:/# df -h Filesystem Size Used Avail Use% Mounted on devfs 3.9G 0 3.9G 0% /dev none 4.0G 2.3M 4.0G 1% /run /dev/sda2 206M 206M 0 100% / /dev/mapper/nvram-crypt 11G 3.0G 7.2G 30% /mnt/nvram /dev/mapper/config-active-crypt 359M 92M 245M 28% /mnt/config_overlay_active_upper /dev/mapper/config-other-crypt 359M 14K 336M 1% /mnt/config_overlay_other_upper config_overlay 359M 92M 245M 28% /etc tmpfs 4.0G 224K 4.0G 1% /dev/shm tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup tmpfs 4.0G 12K 4.0G 1% /tmp

Successful docker run command to bind /config to another directory on host.

docker run -d --name=firefox -p 5800:5800 -v /var/tmp/firefoxappdata:/config:rw jlesage/firefox

completed download

root@om2216-l:/var/tmp/firefoxappdata/downloads# pwd /var/tmp/firefoxappdata/downloads root@om2216-l:/var/tmp/firefoxappdata/downloads# ls -la total 669052 drwxr-xr-x 2 1000 1000 60 Apr 20 01:34 . drwxr-xr-x 7 1000 1000 160 Apr 20 01:31 .. -rw-r--r-- 1 1000 1000 685106000 Apr 20 01:34 c1100-universalk9.17.11.01a.SPA.bin root@om2216-l:/var/tmp/firefoxappdata/downloads#

jlesage commented 1 year ago

Ok great! So I guess this issue can be closed.

dm042023 commented 1 year ago

Absolutely. Thanks very much for the help! This container is exactly what I’ve been looking for at my remote locations. It’s really fast even on this relatively low powered appliance.