this post was submitted on 24 Jul 2023
12 points (100.0% liked)

Programming

13352 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

When running docker dev environment with Linux and Windows (with WSL2), it's already in the same container context so the performance is decent. However, on Mac there's no WSL2 equivalent so bind mounts are painfully slow due to the overhead of translation between the Mac's and container filesystem.
Is there any way to run the code in docker VM like WSL2 allows?

top 10 comments
sorted by: hot top controversial new old
[–] Paradox@lemdro.id 4 points 1 year ago (2 children)

I moved off docker engine and to colima for this very reason. Mounts are speedy now

[–] iamroot@discuss.tchncs.de 2 points 1 year ago (1 children)

Does it support docker compose?

[–] Paradox@lemdro.id 3 points 1 year ago

Yep. Using it daily

[–] s900mhz 2 points 1 year ago (1 children)

I’ve been looking at this, we use Docker Desktop for local development on M1 Macs. Is there a reason to switch? Does it have a lower memory footprint?

[–] Paradox@lemdro.id 2 points 1 year ago

It's a lot more performant, because it makes use of apple's built in virtualization tools. You can adjust how much memory, CPU, and storage are given to the vm

[–] wendan 2 points 1 year ago

OrbStack might work for you: https://orbstack.dev/

[–] Isuro@lemm.ee 2 points 1 year ago
[–] adhdplantdev@lemm.ee 0 points 1 year ago (1 children)

Depending on the Mac you're using you can set up a VM directly using a hypervisor like VirtualBox or UTM to help improve performance. However if you're trying to run a production application on a MacBook using docker you're going to have a bad time. If you're trying to performance test you're better off trying to set up a cloud instance in Amazon using Linux to get better performance

[–] iamroot@discuss.tchncs.de 1 points 1 year ago (1 children)

Production runs on Linux server. The problem is with development environment, I want to avoid Virtualbox as it would be an extra overhead to manage and affect DX.

[–] adhdplantdev@lemm.ee 1 points 1 year ago

Instead of using something like a bind mount you could try using a Network file share like NFS which has pretty good performance or you could use samba but performance is not its strong suit.