129 karma · joined May 23, 2022
I found that when I tried developing inside a clone of my Production Docker environment, I started having to change more and more things over time eg installing Xdebug etc that meant it was not the reliable test environment I hoped it would be.
Re: 2) if that works for you that's great. However a lot of developers end up using Docker abstractions (for very good reasons) such as Lando or Laradock which specifically don't attempt to replicate a production environment any closer than Indigo does. So as @Chrischen says below, use something highly productive for development, and use a clone of your Production Docker stack for QA. Arguably that's the only way to truly be sure your tests pass in your Production environment.
However, assuming you are on Mac, I'm curious what kind of development you do? It seems hard these days to avoid stuff like `composer update` or `npm update` or to compile SASS or to bundle JS and as soon as you do any of those things, with Docker you start to get a syncing feeling. Sorry, shouldn't try to be funny this late in the day... :)
Oh also, when I run Docker for Mac I often get random 100% CPU usage for no reason at all, with no containers running, causing all my fans to spin up to full. I also periodically find I've run out of SSD space because docker has used it all up with qcows or something. And anytime I had to make a config change in one of my images I had to jump through flaming hoops to get it to take effect in the container. Not because of Docker per-se but because I wanted to write PHP or Javascript, not learn how to sysadmin Docker.
> I quickly realised that trying to accurately replicate my production environments locally was not going to be a happening thing
Sorry I wasn't clear; my production environments are docker and as such yes, trivial to get running locally. My experience was that this was far less useful than expected. The moment I started turning on things like Xdebug and implementing mechanisms to deal with non-production .envs etc etc it became less and less useful for me. I'm guessing there are workarounds for all these kinds of issues (or you wouldn't be a proponent), but I do suspect that if you're developing locally in a 95+% clone of a production docker environment, you are one of very few who have managed it and enjoyed it enough to keep doing it. Which is to say you're a legend :D
> staging
Perhaps I used poor terminology; call it "Test". And the Pi was a poor example also, sorry! I don't run Pi's, and my personal dev circumstances are fairly atypical. However, I do feel it's solid advice to suggest that people:
a) run whatever development environment is most productive for you on a daily basis locally, so long as it closely replicates the production environment at the level your job requires. So as a front-end / back-end developer that means the same PHP/MySQL/Nginx versions etc.
b) run a clone of your production environment on a separate machine (local VM / local tiny PC / second VPS, whatever) for testing
> specific differences and issues you've seen in ARM linux vs. x86 linux
Absolutely none (as you probably guessed); I've never run an ARM server, nor had any issues between native binaries on x86 or M1 and their identical counterparts in production. As you suggested, the issues I typically face (and many like me, I expect) are at a different abstraction level from this; most boiled down to a) service configuration differences eg PHP extensions or b) file system issues (eg permissions & case sensitivity).
Re VirtioFS no, when I still used D4M I ran docker-sync with various strategies. It kinda worked. I then ran VS Code's Remote Containers. It kinda sorta worked. Both were annoying on an almost-daily basis.
* MAMP offers a subset of the services Indigo provides (eg MAMP provides two PHPs, Indigo provides seven)
* with Indigo you can run any combination of services all at once if you like (that's a stack in Indigo)
* then in Indigo you can have multiple stacks all running together if you want
* you can share your Indigo stack with a team and have them all running the same stack with one click
So for example, if you maintain a really old Drupal site you might want a stack with PHP 7.2 (or even 5.6) and Apache, and perhaps you're migrating that old site to Laravel, so you'll create a stack with PHP 8.2 and nginx. You can give both their own domain names (eg oldsite.test and newsite.test) and run them both simultaneously. That's super easy to set up in Indigo.
* allow running more than one version at a time (for working on/running multiple projects at differing stages), and
* save you having to install, learn & remember the command line syntax for it; many people find a GUI more productive, despite them often being fully capable of using the command line