DEV Community

Cover image for Don't Build Docker Apps Without This Flag

Don't Build Docker Apps Without This Flag

Jonas Scholz on September 25, 2023

I have a bunch of Docker apps running on one server, and things got tricky when Docker builds decided to grab all the CPU, causing all my other app...
Collapse
 
soanvig profile image
Mateusz Koteja

Why do you build images on the server that is running some important programs?

Collapse
 
wimadev profile image
Lukas Mauser

He never mentioned they were important programs, just CPU sensitive. For a private server setting up an extra build server can introduce unnecessary complexity

Collapse
 
code42cate profile image
Jonas Scholz

I used GitHub actions before, but they were incredibly slow so I just did it on my server

Collapse
 
mitch1009 profile image
Mitch Chimwemwe Chanza

I think it depends on the server and the type of build you had implemented on github actions. I use github actions for all my image builds and distribute them to clouds

Collapse
 
seif profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Seif Attar • Edited

So that they have an excuse to write this click bait article and link to Sliplane which author founded. Hopefully their one server isn't the one running Sliplane.

Collapse
 
wimadev profile image
Lukas Mauser

I was genuinely happy when I found out about this. What’s wrong with sharing some useful info??

Collapse
 
nightfall profile image
jbs123

I created an account just to point out the bullshit.
Seif's comment is marked "Comment marked as low quality/non-constructive by the community."

But he is absolutely correct. This guy is making stupid decisions (building containers on the same server it's running on) just to promote his company that he co-founded. This isn't a tech article, it's advertising...

Thread Thread
 
therealkevinard profile image
Kevin Ard • Edited

This is my first comment in 4+ years, maybe - same reason.

Whatever the underlying reason, adding a very specific flag to literally every build command that ever runs on this box isn't a solution. It's a workaround at best.

It's a neat trick to know, I guess, but even at that it's nothing docker build --help wouldn't solve.

Edit to add: oof dev.to/code42cate/comment/29jl5

Collapse
 
wimadev profile image
Lukas Mauser

This saved my ass ❤️

Collapse
 
shricodev profile image
Shrijal Acharya

Really something to consider adding. Thanks! 🫡

Collapse
 
devalex7 profile image
Alex • Edited

What about limiting the number of cores and/or memory via compatibility mode?
Add to docker-compose
deploy:
Resources:
Limits:
CPUs: '1'
Memory: 2048M

Then > docker-compose --compatibility up

That's what I'm doing, but I will try this out too, thanks!

Collapse
 
code42cate profile image
Jonas Scholz

Yeah! I only skimmed the docs, but this seems to be the same, just for Docker Compose? I rarely use Docker Compose, nice to see that you can do it there as well :)

Collapse
 
sirajulm profile image
Sirajul Muneer

Advertisement alert!!!!!!!

Collapse
 
catshater profile image
Airat Tuktamyshev • Edited

Absolutely bullshit. Bite by antipattern. My ass was flamed I even created account

Collapse
 
xoneill007 profile image
xoneill007

Odd, with Docker being premised on jails / LXC - how is this an after thought. With Solaris and BSD, quotas and resources are always top of mind. Especially with production workloads. How's this an obscured idea.

Collapse
 
click2install profile image
click2install

If you don't want to have the same issue while deploying Docker on your Server, check out ... using a different server like you should be doing.

Collapse
 
code42cate profile image
Jonas Scholz

Of course, but that's not always an option:)

Collapse
 
nicolasdanelon profile image
Nicolás Danelón

wow nice one