News for hackers. Stuff that matters.
Re:Asdf – the language tool version manager by f8 on Monday October 24, 2022 @08:02PM (#33324358)
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.

Re:Asdf – the language tool version manager by jhardy54 on Monday October 24, 2022 @08:41PM (#33324679)
> 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.

Re:Asdf – the language tool version manager by jen20 on Monday October 24, 2022 @09:00PM (#33324821)
> 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.

Re:Asdf – the language tool version manager by jhardy54 on Monday October 24, 2022 @09:29PM (#33325034)
I’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.

Re:Asdf – the language tool version manager by 999900000999 on Monday October 24, 2022 @09:01PM (#33324833)
Absolutely.

Docker is NOT about local dev, it's about deployment.

We forgot this...

Re:Asdf – the language tool version manager by nordsieck on Tuesday October 25, 2022 @01:20AM (#33326540)
> 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.

Re:Asdf – the language tool version manager by dns_snek on Tuesday October 25, 2022 @05:45AM (#33328342)
It 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

Re:Asdf – the language tool version manager by 999900000999 on Wednesday October 26, 2022 @09:19AM (#33343242)
It 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.

Re:Asdf – the language tool version manager by throwawaylala1 on Monday October 24, 2022 @09:02PM (#33324839)
> 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?

Re:Asdf – the language tool version manager by jhardy54 on Monday October 24, 2022 @09:24PM (#33325005)
Ignoring 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.

Re:Asdf – the language tool version manager by jayceekay on Monday October 24, 2022 @10:38PM (#33325514)
you 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?

Re:Asdf – the language tool version manager by viraptor on Monday October 24, 2022 @11:04PM (#33325687)
> 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.

Re:Asdf – the language tool version manager by brightball on Monday October 24, 2022 @10:15PM (#33325369)
Best 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.
Re:Asdf – the language tool version manager by whalesalad on Monday October 24, 2022 @09:12PM (#33324914)
If 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.

Re:Asdf – the language tool version manager by grosswait on Monday October 24, 2022 @10:39PM (#33325521)
They lead by saying how much they liked asdf vs docker. Ergo: proposed solution is asdf no?
Re:Asdf – the language tool version manager by counttheforks on Monday October 24, 2022 @10:52PM (#33325599)
Then 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.
Re:Asdf – the language tool version manager by viraptor on Monday October 24, 2022 @11:01PM (#33325662)
The tool doesn't have to be just better. It needs to be so much better that it's worth: changing defaults / what people use now, changing documentation, verifying it works for all projects, ensuring that nobody has use cases that asdf doesn't address, and actually spending time with the decision maker to present your idea. For a larger company that may mean days of work.
Re:Asdf – the language tool version manager by bipson on Tuesday October 25, 2022 @12:37AM (#33326300)
Days?

In the "big 'ol" companies I worked at, something like that takes months! If even possible...

Re:Asdf – the language tool version manager by waboremo on Monday October 24, 2022 @10:59PM (#33325641)
Ironic, it would have been far more helpful to just ask OP "what are the reasons your company still uses Docker?" instead of mindlessly complaining.
Re:Asdf – the language tool version manager by anonyme-honteux on Tuesday October 25, 2022 @12:03AM (#33326064)
Counter 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.

Re:Asdf – the language tool version manager by searealist on Monday October 24, 2022 @10:49PM (#33325583)
Huh? The whole comment is comparing asdf to docker and saying asdf is better.
Re:Asdf – the language tool version manager by Scarblac on Tuesday October 25, 2022 @01:55AM (#33326752)
He's talking about doing something about it in his job, instead of complaining about it on HN.
Re:Asdf – the language tool version manager by firecall on Tuesday October 25, 2022 @12:42AM (#33326327)
That right there is text-book Ad Hominem fallacy!

It is totally valid to point out failures in something without knowing how to put them right, or being in a position to do so.

Re:Asdf – the language tool version manager by jfabre on Tuesday October 25, 2022 @07:50AM (#33329272)
Exactly, let's first acknowledge there is a problem, then we can find a solution.

Complaining for complaining is not helpful, but don't dismiss problems because no one can think of a better solution at the same time.

Re:Asdf – the language tool version manager by verdverm on Tuesday October 25, 2022 @08:24AM (#33329545)
Sometimes the problem is more that the grass looks greener on the other side. When you realize there are a bunch of day 2 problems for the "better" solution you didn't uncover beforehand, many will enter sunk cost territory
Re:Asdf – the language tool version manager by elysian-breeze on Monday October 24, 2022 @09:21PM (#33324986)
I 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.

Re:Asdf – the language tool version manager by tomtom1337 on Tuesday October 25, 2022 @02:34AM (#33326996)
> 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!

Re:Asdf – the language tool version manager by philihp on Tuesday October 25, 2022 @02:40AM (#33327026)
I'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.
Re:Asdf – the language tool version manager by godinaa on Monday October 24, 2022 @09:40PM (#33325127)
The 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.
Re:Asdf – the language tool version manager by throwawayu32 on Monday October 24, 2022 @10:33PM (#33325479)
I use asdf, nix-shell, docker, docker-compose, and kubernetes... just use what makes sense.
Re:Asdf – the language tool version manager by pmontra on Tuesday October 25, 2022 @02:18AM (#33326896)
In 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.

Re:Asdf – the language tool version manager by geraneum on Tuesday October 25, 2022 @02:35AM (#33327002)
In 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.

Re:Asdf – the language tool version manager by pmontra on Tuesday October 25, 2022 @03:46AM (#33327422)
Yes, 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.

Re:Asdf – the language tool version manager by oftenwrong on Tuesday October 25, 2022 @05:08AM (#33328063)
You probably want to use

    docker compose
not

    docker-compose
The latter was the name of the compose v1 binary, so using it may cause your command to be handled with a v1-to-v2 compatibility mode. Depends on how your installation is setup. Compose v2 is implemented as a Docker CLI plugin.
Re:Asdf – the language tool version manager by kasbah on Tuesday October 25, 2022 @06:34AM (#33328670)
When I invoke `docker compose up` on my project with Docker version 20.10.18 it says:

    The new 'docker compose' command is currently experimental.
Re:Asdf – the language tool version manager by oftenwrong on Tuesday October 25, 2022 @11:36AM (#33332027)
I'm not sure what that means, but I don't think compose v2 is considered experimental at this point. It is included in Docker Desktop, for example. You might be running an older version. You can check `docker compose version`. Version 2.12.2 was released a few days ago.
Re:Asdf – the language tool version manager by wdb on Tuesday October 25, 2022 @05:47AM (#33328350)
Does he run ARM docker images or X86? I can imagine the latter will slow things down
Re:Asdf – the language tool version manager by Lutger on Tuesday October 25, 2022 @02:40AM (#33327023)
I 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 non 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.

Re:Asdf – the language tool version manager by chriswarbo on Tuesday October 25, 2022 @06:04AM (#33328453)
> 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)

Re:Asdf – the language tool version manager by sascha_sl on Tuesday October 25, 2022 @08:51AM (#33329804)
I'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.

Re:Asdf – the language tool version manager by chriswarbo on Tuesday October 25, 2022 @10:23AM (#33330844)
> 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/...

Re:Asdf – the language tool version manager by sascha_sl on Wednesday October 26, 2022 @04:49AM (#33341261)
It 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.

Re:Asdf – the language tool version manager by chriswarbo on Thursday October 27, 2022 @05:15AM (#33355118)
"Base image", AKA a cached snapshot, like I said ;)
Re:Asdf – the language tool version manager by oftenwrong on Tuesday October 25, 2022 @06:10AM (#33328491)
What 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.