5 ms·
Used this at my last company. Super painless and makes setup a breeze. Current company uses Docker and I hate it. Every company I've been at loves to throw ever
by f8 4y ago
Used this at my last company. Super painless and makes setup a breeze. Current company uses Docker and I hate it. Every company I've been at loves to throw everything into a container. Even if you setup your dev configs to maintain hot reloading, it's always slower. Node package management is also a pain no matter how you implement it with Docker it seems.
I also hate the Docker tagline that it "eliminates 'works on my machine' issues". I believe a tool like asdf would also achieve this (correct me if I'm wrong). Docker itself can go haywire depending on the machine and you're basically in hell fighting with it just to get your dev environment working. You essentially eliminate one problem in exchange for a variety of equally frustrating challenges.
- jhardy54 4y ago> I believe a tool like asdf would also achieve this (correct me if I'm wrong). This is true for very simple applications, where you’re just running `npm ci` or `pip install`, but breaks down as soon as you have sophisticated dependencies with system / library requirements or dependencies (e.g. databases, caches, message brokers, queues) that are beyond the scope of asdf. Also, since you’re probably deploying containers to production, it’s useful to have a similar environment for local development so that you know what will actually happen in production.
- jen20 4y ago> since you’re probably deploying containers to production Citation needed I feel - I’d wager the number of containerized deployments pales in comparison to the number of binaries scp’d into a production host.
- jhardy54 4y agoI’d also be interested to know the answer! I said “probably” because the vast majority of deployments I’ve done over the past decade have been containerized, but I have no trouble believing that my experience isn’t indicative of the average.
- 999900000999 4y agoAbsolutely. Docker is NOT about local dev, it's about deployment. We forgot this...
- nordsieck 4y ago> Docker is NOT about local dev, it's about deployment. I mean... if Vagrant can be about local development, I don't see why Docker can't be about local development too.
- dns_snek 4y agoIt can be anything you want it to be, especially inside the confines of your own setup. Do you want to quickly debug some software that relies on an older version of Postgres 9 but you don't want to clutter your host machine? Just run the following command to fetch and start an instance. With --rm flag it's going to be removed as soon as you terminate it: docker run --rm -p 5432:5432 postgres:9
- 999900000999 4y agoIt can be. But that was never the primary purpose of Docker. Like I can use Mac Minis as door stops, etc. Docker runs best on top of Linux. As in actually run a Linux host , everything else in my experience is a hack. As long as you have internet access, spinning up an ec2 instance to test stuff shouldn't be too hard.
- throwawaylala1 4y ago> Also, since you’re probably deploying containers to production, it’s useful to have a similar environment for local development so that you know what will actually happen in production. This such a complete and utter lie and I'm surprised people in 2022 still believe it. You do know what's happening when you run Docker on your Macbook, right? Right?
- jhardy54 4y agoIgnoring your tone, here’s a concrete example: I was debugging a HTML-to-PDF service that was crashing for some payloads, but I couldn’t reproduce the problem locally. I used Docker to run the application using the exact same image that was deployed to production, and was able to replicate the issue. Why? Because the PDF renderer depended on loads of finicky dependencies (e.g. linked libraries), and it turns out that the default fonts in our base image didn’t support the Unicode code points in the example payload. I couldn’t replicate this outside of Docker because I have a completely different set of linked libraries and don’t stack. Happy to answer any questions you have.
- jayceekay 4y agoyou always have that option though and i assumed it was a fairly common debug thing to have to do if you use docker enough. not just for the times it works (ie you find a bug between the layers) but for all the times it isn't the culprit. the other post mentioned setup, so i thought he meant they imposed presetup containers for developers to use?
- viraptor 4y ago> You do know what's happening when you run Docker on your Macbook, right? A Linux vm spawns a process with new namespaces - which is often exactly what happens in production as well.
- brightball 4y agoBest dev setup I've seen has been to use Docker compose for all of those dependencies, but just use asdf for the main application development. You get all the dependency wins of Docker for the peripherals but with the faster native local dev experience.
- whalesalad 4y agoIf you genuinely think you have a better way to do it, propose it. Don't sit back with the terrible attitude of "my company does it this way which sucks" - why not try to make things better? There are two possibilities - a) you are right, you know something your company doesn't, and by proposing your new plan in a constructive manner you might make life better for everyone b) you are wrong, you don't fully comprehend the surface area of the software you are working on, and your suggestion is short sighted and doesn't account for all of the requirements. Either way it is helpful to put it out there - so long as you do it from the right place, with the right intention. Either you'll humble yourself, or you will eliminate an unnecessary dependency and make life easier for your team.
- grosswait 4y agoThey lead by saying how much they liked asdf vs docker. Ergo: proposed solution is asdf no?
- counttheforks 4y agoThen why does their company still use docker for that? Did they fail to convince anyone else? Did they disagree? Did they not even bother bringing up their frustrations? People love to complain, but rarely try to contribute to actually make things better.
- waboremo 4y agoIronic, it would have been far more helpful to just ask OP "what are the reasons your company still uses Docker?" instead of mindlessly complaining.
- anonyme-honteux 4y agoCounter argument: your version is fine and may have helped to solve one particular issue in one particular company. But countless developers in countless companies have each their own set of frustrations where they sense that something could be improved but don't know what to do with the frustration. Frustrations are a useful symptom but learned helplessness is a terrible thing that can lead to anything from being annoyed to leaving your job to depression. I would argue that the response was in fact a very valuable lesson.
- elysian-breeze 4y agoI found docker to be pleasant to work with for support services (if your app needs postgres, redis, mail service, pdf converter, object storage, etc) in development and you need an easy command (docker-compose down; docker-compose up) to tell designers and product people to easily reset their environment to a sane state. It is NOT great for having a live-reloading dev webservice running. People seem to swing for an all in one solution, but consideration is needed about what services you want in docker or not. Docker is great to have preconfigured database environments that are easy to tear down and start from scratch and works across multiple platforms. Docker is bad for local dev server.
- tomtom1337 4y ago> It is NOT great for having a live-reloading dev webservice running. Oh my god this. I was running a fastapi server on my m1 Mac in an arm Linux docker container. Everything else works great in this, but the live-reloading server was running at 200% cpu and ate 50% of my battery life!
- philihp 4y agoI've found a lot of docker wins come from installing modules which have native bindings. I still hate running my dev server in docker, though.
- godinaa 4y agoThe only problems I’ve ever seen a coworker or myself encounter with docker is not knowing it well enough. Admittedly it has a strong learning curve. There are things that will not work unless you know certain underpinnings of docker, dns/networking, etc. But to say it doesn’t work and goes haywire doesn’t make sense. It’s an extremely stable piece of software.
- deleted 4y ago[deleted]
- throwawayu32 4y agoI use asdf, nix-shell, docker, docker-compose, and kubernetes... just use what makes sense.
- pmontra 4y agoIn my experience as web (mostly) backend developer on Linux targeting Linux servers: - docker is good when the deployed software runs on docker too, because dev and prod are the same and on Linux the performance hit is negligible if any. If you're on Mac or Windows it seems that it can be felt. - docker is a good way to distribute the development environment, anecdotally much better than Vagrant or bare VMs. - However having to always prefix commands with docker exec container is a little pain. Working in docker exec container bash is worse. - Sharing only volumes between the host file system and docker means that sometimes I have to copy files to the shared volume instead of addressing them where they are. - asdf doesn't have all those problems but I must be careful to pick different ports for different postgresql servers in different projects. Docker would shield those ports inside the network of the project. All considered, I use docker when a customer uses docker, VMs when a customer uses VMs, asdf for all the other cases including my own software which I never deployed to docker so far. If I did I'd probably work in docker because I don't want surprises at deployment time.
- geraneum 4y agoIn reality, when using Docker, Dev and Prod are almost never the same. We usually install different packages in Dev image i.e. debuggers or linters, we try to optimize the heck out of the Prod image, thus using a different build of the base image, etc. And all this, when you are only developing on Linux for Linux. I’m not saying this is the right way but this is very common. I also agree with the rest of your points.
- pmontra 4y agoYes, I agree. I'm working on a Rails project today and the container in development has some gems we only use for development and testing: byebug, pry, rspec, timecop, simplecov, factory_bot. They won't go into the production images. The instructions for developers are docker-compose build docker-compose run --rm api bundle docker-compose up api is the name of the service in docker-compose.yml One developer has a M1 Mac and he's using something called mutagen instead of docker. His docker-compose.yml is a little different and he's paying a performance penalty. His M1 is only 50% faster than my Intel from 2014 at running the test suite (50 seconds vs 75.) The difference is not noticeable when running only a few tests per time when working on a single feature.
- Lutger 4y agoI personally love docker. Almost all of it makes sense to me. It's not perfect, but very pragmatic, almost in a blunt way. On a workstation level, people who really know their way around stuff tend to dislike docker in my experience, and for people who don't its still too difficult. One problem I think it has is that docker - still talking about workstations here - solves mostly problems on the team level, not on an individual level. But individuals tend to regard those problems as 'other peoples problems'. Another problem is that you can work with docker just fine with barely knowing how it works, until there's a problem. In my experience, developers tend to immediately blame docker for the problem, even though its a misconfiguration of npm for example, which they would also have in a native installation. Still, docker solves a lot of problems that aren't solved by asdf, apt or rpm, which is why it continues to be relevant and used also for workstations. EDIT: docker on windows before wsl2 was hell too, a lot of discontent about docker that people have comes from those installs. On wsl2 it's mostly fine, if you don't attempt to mount from an ntfs file system.
- chriswarbo 4y ago> I also hate the Docker tagline that it "eliminates 'works on my machine' issues". Docker basically just takes a snapshot, which hides the problem rather than fixing it: when we want to change something, like updating a dependency, we're back to the same dependency hell. Even worse, those snapshots are often not reproducible (e.g. running things like `apt-get install -y foo`, which depends on the latest contents of third-party servers). Again, Docker tries to hide the problem by putting snapshots into a cache. To avoid these problems, we need the discipline to do sensible things (e.g. using specific .deb packages, rather than apt-getting whatever's latest; or using something more brute-force like Nix). Yet once we do that, there's usually no point doing it with Docker at all; since those commands work perfectly well outside of a container (if we want a container to deploy, we can tar up the resulting directory)
- sascha_sl 4y agoI'm not sure what you mean by "snapshot" when most docker images are instructions to (more or less) reproducibly create an image. I hope you don't COPY your entire system into the container at least.
- chriswarbo 4y ago> most docker images are instructions to (more or less) reproducibly create an image I can't recall ever encountering such a thing myself. On the other hand, I've seen LOTS of this sort of thing: RUN apt-get update && \ apt-get -y install apache2 The above is taken from official AWS documentation[1] but it's pretty rampant. As I mentioned above, when the instructions are reproducible, there's no point using Docker to run them; a shell script would suffice. [1] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-container-image.html#create-container-image-create-image https://docs.aws.amazon.com/AmazonECS/latest/developerguide/...
- sascha_sl 4y agoIt depends a lot on your base image. If you use Debian locked to a release, you'll likely get the same Apache version plus small fixes / security fixes (whatever the exact Debian policy is). That's not reproducible in the sense of "reproducible software", but it is usually good enough to build other things on top of. If you want reproducible in the sense of unchaging/same digest, you should make a custom base image with the things you never want to change and pull it from somewhere.
- oftenwrong 4y agoWhat use case are you addressing here? Docker can be used to maintain development tools in various ways, but I see it as mostly operating on a different level from asdf. For example, asdf can install tools on a developer's system. asdf can route invocations to the appropriate version of an installed tool. Docker can be used to install tools in isolation by way of an image build. That image can be shipped off, so that developers can pull the image, and do not have to run an installation procedure. Docker can pull and run the appropriate version on demand upon invocation. It's also not a binary choice. You can use asdf in a Docker container, and you could use Docker in an asdf plugin.