It's a lot to learn, but Nix solves your issues precisely.
You can build lean, layered Docker images with ease with it. And deploy those to container services like any other.
But you don't have to use those containers for development. You use Nix to set up your dev env (a lot will come for free after you have your code packaged for the container).
Nixpkgs has support for most mainstream languages nowadays, with varying levels of popularity. The more popular ones will have more polished Nix integration.
Now, if you _do_ want to use the container locally, you can do that too. And it will benefit from non-fragile caching thanks to Nix.
But tbh, if you need to replicate prod precisely locally to do local dev, you should probably consider..figuring out how to build and test your components with confidence in isolation. Local simulation of prod can be useful sometimes but if it's your default, you can do better.
+1 for this - I've essentially replaced all of my local tooling for my own projects as well as where I work with nix. Consistent, stable environments that include every dependency have been a breath of fresh air for development across the board. Being able to build lightweight containers from these nix derivations that match the local env perfectly is a huge bonus - you can even stream directly from the nix store into remote docker registries with something like nix2container!
100% this. Only use containers for remote execution: CI, staging, production. Run native code locally. Manage dependencies and isolate project environments with NIX.
You can build lean, layered Docker images with ease with it. And deploy those to container services like any other.
But you don't have to use those containers for development. You use Nix to set up your dev env (a lot will come for free after you have your code packaged for the container).
Nixpkgs has support for most mainstream languages nowadays, with varying levels of popularity. The more popular ones will have more polished Nix integration.
Now, if you _do_ want to use the container locally, you can do that too. And it will benefit from non-fragile caching thanks to Nix.
But tbh, if you need to replicate prod precisely locally to do local dev, you should probably consider..figuring out how to build and test your components with confidence in isolation. Local simulation of prod can be useful sometimes but if it's your default, you can do better.