Freecodecamp: Consider adding the 'delegated' flag to boost docker perf. on macOS

Created on 12 Aug 2020  路  7Comments  路  Source: freeCodeCamp/freeCodeCamp

Is your feature request related to a problem? Please describe.
Building project using docker on macOS is notoriously slow, after some googling, I found that there's some ways to boost the performance of this process.

I post the link to the posts I read in here just in case someone want some reference
Performance tuning docker for mac(from community blog)
Performance tuning for volume mounts (shared filesystems)(official doc)

Here's the link to performance comparison
Docker on Mac Performance: Docker Machine vs Docker for Mac

Here's the GitHub issue related to the subject
Pertinent Issue

In a nutshell, building project with docker on mac is unbearably slow, so, I use delegated flag when run docker,

here's the screenshot on how I modified my docker-compose.yaml to make the build process from almost forever to just a few second: (I still modify a section but there's no enough space to include that to the screenshot, anyway, you can tell from the preview pane on the upper right馃槄)
image

Describe the solution you'd like
So, I suggest include this change to yaml file in the project, or(see next)

Describe alternatives you've considered
Add an extra notice to the contribution doc, letting those who use mac be aware this issue and let them know how to alleviate the pain.

PS: I'm also happy to help with this issue馃槅

feature request

All 7 comments

Sure, the docker setup guide has not seen much love lately. Its intial intention was to remove the friction of installing the services like MongoDB, etc.

However, it has become painfully slow when setting up from scratch.

Please feel free to open a PR for benifit of everyone.

@raisedadead Thanks for the response!

So, which option do you recommend?

  • modify the docker-compose.yaml file and make the PR
  • add a new notice in the contribution guide for those who run the project from scratch

PS: thanks to the usage of flag delegated, I never hear those crazy fan noise from my old MBP anymore 馃槅 and the CPU usage of the docker is really low now~

Lets start by adding the flag like you have tested. We could merge the PR and keep it under observation for a few days. We could add a warning or remove/overhaul the docker setup if the flags break something, later.

@raisedadead Hey, man, thanks for the advice and sorry for not keeping the update or work on it for several days, I'm currently dealing with some life emergency, and magically, the only thing that can let me feel less painful or pain-free is immerse myself in the world of coding馃槀 how crazy!

Anyway, I just opened a PR and hopefully that can help a lot of people using mac and try to build the project from docker~

PS: I kind of favor adding a note on the guide to remind those with mac to do the delegated flag thing when they build the project, because slow building only happen on mac I think, although this could lead to problems like forgot to remove the flag in the file when they commit so they push to the remote and cause a lot of conflicts...

Anyway, adding this flag while building on PC or Linux shouldn't cause any problem I think, because delegated means the change between host and container is not in sync immediately... hmm... sounds like a problem... but for more on it I think you should consult the docker doc I posted above馃槄

I'm currently dealing with some life emergency, and magically, the only thing that can let me feel less painful or pain-free is immerse myself in the world of coding馃槀 how crazy!

Hey Benjamin.

Hope that you are hanging in well. Stay strong and I wish you the very best in whatever you are dealing with. Keep doing what you love.

Thanks a lot for the PR, and your contributions during these hard times. I will take a look at the PR and will check your recommendations.

I hope you have a great day ahead. Goodluck.

@raisedadead Thank you so much for the kind words you said, you have no idea what they means to me during this time... thank you!!!! And I am really grateful that I am able to find peace inside the world of code...

Also, there seems some problems of the cypress testing of my pr.... dang it... 馃槀 anyway, I will have a look on it as well later. Thank you guys!

Stay safe! And have a great day!

Hey @SeasonLeee, I'm glad you're able to find some peace, that's some good news.

As for the cypress testing, don't worry about it - I'll investigate. It's almost certainly not your code. It looks like a old bug that I thought I'd squashed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelLeeHobbs picture MichaelLeeHobbs  路  3Comments

QuincyLarson picture QuincyLarson  路  3Comments

vaibsharma picture vaibsharma  路  3Comments

jurijuri picture jurijuri  路  3Comments

DaphnisM picture DaphnisM  路  3Comments