I’m sending this post just for info. I multiple times tested building process in same way in Docker container and on same host system and the result was always the same. Building process inside the Docker was multiple times - 5x and more slower, than run the same process on host system. Cache, resources limitation or another recommendations was not a problem. I tries the performance tests and the result was, that there was not signifficant difference between docker and host system, therefore the idea was, the reason why the building process is so slow in docker is filesystem.
I tried to update my CI pipeline and I created a tmpfs inside docker, where I copy Meteor files before start the building process. When I’m building on this tmpfs, building is more than 5-times faster like before.
My old related Topic here: Veeery long building time inside Docker container - #29 by a4xrbj1
Thx,
Have a nice day 
1 Like
I think the process your describing then is opposite of the process of how something like the disney/meteor-base works that intentionally uses a multi-stage Docker workflow so you don’t have to copy in the Meteor files into your actual container?
From their readme:
Using a multistage Dockerfile on your app’s side means that you can publish a much smaller final Docker image that doesn’t have Meteor included
Just curious if I’m understanding correctly. You’re saying bundling Meteor into the host container makes it build much faster?
Hi @evolross, when you will check disney/meteor-base here, you will found the script for building process:
meteor-base/src/docker/build-meteor-bundle.sh at main · disney/meteor-base · GitHub
You will find there mkdir --parents $APP_BUNDLE_FOLDER
When you start building process, building will be multiple times slower like when you start same building on host machine. To confirm, you can try it by self.
I have a bigger app with lot of react and scss and building takes 35minutes in docker and 5minutes on host machine.
After veeery loooong investigation I found, that If inside docker concainer I will reate tmpfs (ramdisk), it will solve problem with slow read/write operations and building inside docker takes similar time like on host machine. Now I have building time 5min. inside docker and 5min on host machine (7 times faster!!!).
1 Like