4 ms·
> People often say "It works on my machine (and not in cloud)...", to avoid this we have simple solution - always run in docker container. And when I say always
by throwaway894345 7y ago
> People often say "It works on my machine (and not in cloud)...", to avoid this we have simple solution - always run in docker container. And when I say always I really mean it - build in container, run in container, test in container. Actually I didn't mention it in previous section, but the make test really is "just" docker run.
I've had nothing but bad luck with Docker for Mac. It's been super slow. If any container is running at all, the com.docker.hyperkit process eats 160% CPU even if `docker stats` shows the process hovering near 0% CPU. This has been the case for our entire team, and we're in the process of moving away from it.
- jhoechtl 7y agoWhy aren't you using Linux then?
- sdegutis 7y agoNot GP but Linux on laptops often has its own problems, including unreasonable battery usage that's non-trivially hard to fix.
- throwaway894345 7y agoI like Linux as much as the next guy, but the Linux desktop ecosystem (hardware and software) doesn't get the investment it needs to be on-par with Mac. It's cheaper and easier to jettison Docker than MacOS.
- ben0x539 7y agoNot the person you're responding to, but I'd like to add a data point. I try to use Linux where I can (I use it at home and for personal projects). Alas, I work in an environment where MacOS users are prioritized, so sometimes I cannot use tools or access services controlled by other people who still have "linux support" somewhere in their backlog. Depending on how critical these apps are for my work, putting up with eg. a sub-par Docker experience on MacOS may be the lesser evil.
- nickjj 7y ago> I've had nothing but bad luck with Docker for Mac. It's been super slow. I'm not sure if this affects every Mac user. I have a Docker course that has over 15,000+ people who signed up, of which a little less than half use MacOS and of that I've only had a handful of people mention really poor volume performance. I don't have enough data points to know exactly what the cause is. It's definitely a legit problem and it does affect a decent amount of people because I've seen the posts in other places too, but I don't know how wide spread the problem really is. It might be some type of hardware / OS version / tech stack combo (some languages and frameworks require dealing with many more files than others). I happen to use Docker for Windows and it's really really fast too for reference and I never had anyone mention slow volume performance in large apps. Native Linux is as good as it gets as well. I hope one day the folks at Docker figure out why the performance is so bad for some Mac users.
- throwaway894345 7y agoYeah, it affects everyone working on our project. I'm certain it's volume performance, but we've tried all of the workarounds, docker-sync, and several other suggestions. Also (and respectfully), I wonder if your frequency of incidence is artificially low given that many courses tend to use toy-esque projects (although perhaps yours isn't, somehow?)?
- nickjj 7y agoThe main app in the course is based off the original cats vs dogs example provided by Docker. It's a combination of a .NET, Node and Flask app all wrapped together in Compose. It's not a huge project, but it does touch a few different web frameworks. Most of the people who take the course go off to Dockerize their own applications using whatever framework they use. Most of the people who have mentioned slowness were working with Laravel apps, but there were also a few using large Node apps too. In all cases they were using a Mac. No one has mentioned slow volume performance issues on Windows that wasn't fixable with tweaking a Windows setting or 2. Most of the time it was Windows defender (or some other anti-virus tool) drastically slowing down I/O.
- sebazzz 7y agoDocker, it works on my machine. --- But to add a serious note, why is every dependency on the environment so complicated that we just wrap it in some container to just get rid of it?
- throwaway894345 7y ago> But to add a serious note, why is every dependency on the environment so complicated that we just wrap it in some container to just get rid of it? Bad build/dependency-management tooling and non-perfect abstractions over system APIs probably account for most of the issue. Containers are conceptually useful; it's nice to have ephemeral, isolated environments. But if it literally eats all of the CPU it can get its hands on, then it's not useful.
- lowmagnet 7y agoMy default is to use environment-based configuration (12f) while running in a scratch-or-at-largest-alpine-base image. This precludes a lot of things like shell-scripted startup, but then again, why are we running go if not to generate one binary as the entry point?
- ben0x539 7y agoBecause we've chronically underinvested in universally useful dependency management tooling, so the state of the art is a jungle of partial solutions that don't compose.
- tln 7y agoThat's annoying, but has not been my experience. How many CPUs are you giving to Docker Engine (Preferences > Advanced)?
- randallsquared 7y agoThis used to be very common with Docker for Mac, but for most people it's been fixed for years at this point. You might want to try a fresh install of DfM, just for curiosity's sake.