Live data from Hacker News

LXC vs. Docker

earthly.dev

141–147 of 147 posts

Re: LXC vs. Docker

#141

Earlier quoted context omitted.

> Docker became popular because it allows one to build, publish and then consume containers. True, but Docker is an awful choice for those things (builds are performed "inside out" and aren't reproducible, publishing produces unauditable binary-blobs, consumption bypasses cryptographic security by fetching "latest" tags, etc.)

> builds are performed "inside out" and aren't reproducible This is probably a good argument because of how hard it is to do anything in a reproducible manner, if you care even about timestamps and such matching up. Yet, i'd like to disagree that it's because of inherent flaws with Docker, merely how most people choose to build their software. Nobody wants to use their own Nexus instance as a storage for a small set…

Re: reproducibility, you're right; yet pretty much all of those arguments can be applied to much simpler, well-established technologies; even something like Make (awful syntax notwithstanding!).

IMHO, the real 'trick' with Docker isn't really container runtimes, images, layers, etc. It's the willingness to avoid system dependencies in favour of doing everything inside a "container image" (AKA .tar.gz). That would seem crazy to a Makefile writer in the 80s, but once we become willing to do this, the actual technique can be implemented using something like Make (with appropriate use of `./configure --prefix` arguments, 'export PATH=...' commands, etc.).

Sure it would be leaky, inefficient, etc. but as you say, the majority of devs wouldn't mind (just like with Docker).

To be clear, I'm not advocating anyone actually try doing this with Make, or whatever. I'm just pointing out that many of the claimed advantages of containers (in general) and Docker (in particular), like being sort-of isolated, or sort-of cross-platform, etc. are actually completely orthogonal to the underlying technology. Instead, those advantages come from the way they tend to be used.

Unfortunately, some of the downsides also come from the way they tend to be used (e.g. putting an entire OS inside a container, rather than just the intended binary + its deps; or using 'latest' tags instead of hashes)

> It's just a file system that consists of a bunch of layers, isn't it?

Exactly. Hence it's hard to check whether, for example, the bin/foo executable contains a patch for CVE-1234, or whatever.

Compare this to e.g. Maven .poms, Nix .drvs, etc. which tell us what went into any particular artifact.

> Actually, there's no reason why you should limit yourself to just using tags, since something like "my-image:2022-02-18" might be accidentally overwritten unless your repo specifically prevents this from being allowed. If you want, you can actually run images by their hashes

Indeed, this is actually a really nice thing about Docker (which has since been incorporated into OCI). However, the tragedy is that it tends to get bypassed in favour of tags, and more specifically just 'latest'.

Re: LXC vs. Docker

#142
LXC and Docker comparisons vastly differ depending on the use case and problem segment. I use LXC as a tiny, C-only library to abstract namespaces and cgroups for embedded usage [1]

LXC is a fantastic userland library to easily consume kernel features for containerization without all the noise around it… but the push for the LXD scaffolding around it missed the mark. It should’ve just been a great library and that’s how we use it when running containers on embedded Linux equipment

[1] https://pantacor.com/blog/lxc-vs-docker-what-do-you-need-for...

Re: LXC vs. Docker

#143
post #64
post #52

Earlier quoted context omitted.

Running the same script every time doesn't necessarily guarantee the same result. Lots of docker build scripts have the equivalent of date > file.txt or curl https://www.random.org/integers/?num=1&min=1&max=1000&col=1&base=10&format=plain&rnd=new > file.txt Buried deep somewhere in the code. But yeah I don't see any reason why you couldn't theoretically make a reproducible build with Docker.

If you have dynamism like this in your build, doesn't that imply that no build system is reproducible?

My point was just that Docker doesn't ensure reproducibility. Whether a build is reproducible or not depends on the steps used, so its possible but not "ensured".

If you wanted to guarantee reproducibility, a hypothetical purely-functional build system could do that. I personally don't think that's necessary though, or that it would be worth the requisite trade-offs.

Re: LXC vs. Docker

#144

One major limitation of LXC is that there is no way to easily self host images. Often the the official images for many distributions are buggy. For example, the official Ubuntu images seem to come with a raft of known issues. Based on my limited interactions with it, I'd recommend staying away from LXC unless absolutely neccesary.

> there is no way to easily self host images When you run lxd init there's an option to make the server available over the network (default: No), if enabled you can host images from there. lxc remote add myimageserver images.bamboozled.com lxc publish myimage lxc image copy myimage myimageserver lxc launch myimageserver:myimage

That's half the story, I don't want to have to build my own infra to host something simple like an image in a redundant highly available way.

In the end I just settled from hosting on s3, downloading the images with curl (or similar) and running `lxc import`.

The support in configuration management tooling is also pretty limited and the stuff I've used has been fairly buggy, in my opinion, because it's not very popular.

Re: LXC vs. Docker

#145
post #42

LXD (Canonical's daemon/API front end to lxc containers) is great -- as long as you aren't using the god awful snap package they insist on. The snap is probably fine for single dev machines, but it has zero place in anything production. This is because canonical insists on auto-updating and refreshing the snap at random intervals, even when you pin to a specific version channel. Three times I had to manually recover…

I got so annoyed with snapd that I finally patched the auto-update functionality to provide control via environment variable. It's ridiculous that this is what I have to personally go through in order to maintain control of when updates are applied on my own systems. If enough people were to ever decide to get together and properly fork snapd and maintain the patched version I'd totally dedicate time to helping out.…

Agreed, it's the stupidest thing around, especially because Linux is about having control of your own systems, then they force updates down your throat, it goes against a lot of the things I use Linux for.

I just avoid snap and Ubuntu wherever possible now.

Re: LXC vs. Docker

#146
post #42

LXD (Canonical's daemon/API front end to lxc containers) is great -- as long as you aren't using the god awful snap package they insist on. The snap is probably fine for single dev machines, but it has zero place in anything production. This is because canonical insists on auto-updating and refreshing the snap at random intervals, even when you pin to a specific version channel. Three times I had to manually recover…

I was bitten by LXD auto-updating as well. Server was down and I couldn't understand why since I hadn't changed anything.

Re: LXC vs. Docker

#147
post #69

Earlier quoted context omitted.

We blocked the annoying snapd autoupdate behavior by setting a http proxy to a nonexistent server. Whenever we had a maintenance window we would unset the proxy, allow the update, then set the set the nonexistent proxy server again. Very annoying.

this feels both clever and stupid at the same time - not you but the software games you have to play.

[deleted]
Post reply on HN