nix2container
Moby
nix2container | Moby | |
---|---|---|
9 | 213 | |
453 | 67,805 | |
- | 0.3% | |
6.3 | 10.0 | |
6 days ago | 5 days ago | |
Go | Go | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nix2container
-
Nix is a better Docker image builder than Docker's image builder
No discussion about Nix-built containers is complete with nix2container:
https://github.com/nlewo/nix2container
It is truly magical for handling large, multi-layered containers. Instead of building the container archives themselves and storing them in the nix store, it builds a JSON manifest that is consumed by a lightly patched version of skopeo that streams the layers directly to either your local container engine or the registry.
This means you never rebuild or reupload a container layer that is unchanged.
-
Way to get NVM working in CI/CD systems
- Container images are built with https://github.com/nlewo/nix2container instead of Nix's built-in docker tools, because nix2container allows configuration of layers and thus makes it easier to share layers between images and improve layer caching.
As for integrating it into our CI pipeline, this is pretty much CI system agnostic as all you have to do is run `nix build ...` inside the pipeline, generating a `result` directory or file as an artifact that, in the case of nix2container, can be pushed to your container image registry.
-
How do I create a docker image for postgres with nix?
dockerTools is the canonical way, but https://github.com/nlewo/nix2container seems to be gaining support as it's faster and doesn't use so much disk space while building.
-
We deploy 5X faster with warm Docker containers
> The key factor behind our decision was the realization that while Docker images are industry standard, moving around 100s of megabytes of images seems unnecessarily heavy-handed when we just need to synchronize a small change.
I think the culprit is more the GitHub Actions cache than Docker since it seems to be hard to get a clean cache management. I'm not sure about caching Docker image layers, but caching the Nix store with GitHub Actions is pretty complicated (not even sure it's possible): this means we have to download all required Nix store paths on each run, but i consider this is because of a GitHub Action cache limitation.
So, did you consider using another CI, which offers better caching mechanisms?
With a CI able to preserve the Nix store (Hydra[1] or Hercules[2] for instance), I think nix2container (author here) could also fit almost all of your requirements ("composability", reproducibility, isolation) and maybe provide better performances because it is able to split your application into several layers [2][3].
Note i'm pretty sure a lot of Docker CI also allows to efficiently build Docker images.
[1] https://hercules-ci.com/
[2] https://grahamc.com/blog/nix-and-layered-docker-images
[3] https://github.com/nlewo/nix2container/blob/85670cab354f7df6...
-
Launch HN: Depot (YC W23) – Fast Docker Images in the Cloud
FYI, the nix2container [1] project (author here) aims to speedup the standard Nix container workflow (dockerTools.buildImage) by basically skipping the tarball step: it directly streams non already pushed layers.
[1] https://github.com/nlewo/nix2container
-
Crafting container images without Dockerfiles
To get Rust incremental builds, did you consider using something such as crane https://github.com/ipetkov/crane ?
And regarding OCI images, i built nix2container (https://github.com/nlewo/nix2container) to speed up image build and push times.
-
Optimising Docker Layers for Better Caching with Nix (2018)
For a more modern iteration of that idea, check out https://github.com/nlewo/nix2container
It has all the benefits of OP but produces the images much faster, and with less on-disk usage.
-
Nixpacks takes a source directory and produces an OCI compliant image
I've been using nix2container[1] for awhile now. It looks like this depends on Docker, have you guys considered removing that dependency? It shouldn't be necessary to create an OCI compliant image with Nix.
[1]: https://github.com/nlewo/nix2container
-
Nixery – Docker images on the fly with Nix
With https://github.com/nlewo/nix2container, I'm trying to make a more standalone tool. Basically, a Go binary takes a reference graph and produces a JSON file describing a container image. This JSON file is then ingested by a Skopeo fork (it adds a new `transport`) to produce images (to file, registries,...).
Currently, it supports the dockerTools layering algorithm and is designed to work with Guix [1] as well;)
[1] https://github.com/nlewo/nix2container/blob/065e5b108650ee4c...
Moby
- An open framework to assemble specialized container systems
-
Release Radar • March 2024 Edition
Having been featured in our February 2023, and January 2024 Release Radars, Moby is the original Linux Container runtime. This new version adds a bunch of changes to the Docker CLI and Moby itself with additional features. There's bug fixes and enhancements, with the main thing for users to be on the look out for containers that were created using Docker Engine 25.0.0. These containers might have duplicate MAC addresses, and thus must be recreated. The same goes for those containers created with Moby 25.0+ and with user defined MAC addresses. Read up on all these changes in the release notes.
-
Choosing a Name for Your Computer
Formlabs does this as well for their 3d printers, my earliest encounter of this was when Docker started getting popular: https://github.com/moby/moby/blob/master/pkg/namesgenerator/...
- Docker Inc. refuses to patch HIGH vulnerabilities in Docker
-
Do not install Docker Desktop on GNU/Linux systems
Try to use moby instead since that is the engine in Docker.
https://github.com/moby/moby
-
Exploring Podman: A More Secure Docker Alternative
> Podman is designed to help with this by providing stronger default security settings compared to Docker. Features like rootless containers, user namespaces, and seccomp profiles, while available in Docker, aren't enabled by default and often require extra setup.
Seccomp has been enabled by default since 2015: https://github.com/moby/moby/pull/18780
It is true that Rootless isn't enabled by default but its "extra setup" can be done with a single command (`dockerd-rootless-setuptool.sh install`)
- Moby: Block io_uring_* syscalls in default profile
- Io_uring will be blocked by default on Docker
-
OpenZFS 2.2: Block Cloning, Linux Containers, BLAKE3
Perhaps.
Thing is, https://github.com/moby/moby/blob/670bc0a46c4ca03b75f1e72f73... is using https://github.com/mistifyio/go-zfs which features code like `out, err := zfsOutput("get", "-H", key, d.Name)` (Source: https://github.com/mistifyio/go-zfs/blob/master/zfs.go#L315) to get a single zfs property.
Somebody chose to use a library as abstraction that looks good but is implemented as a MVP (nothing wrong with that). "In the future, we hope to work directly with libzfs" should have raised an alarm somewhere, though.
What are some alternatives?
naersk - Build Rust projects in Nix - no configuration, no code generation, no IFD, sandbox friendly.
podman - Podman: A tool for managing OCI containers and pods.
crate2nix - rebuild only changed crates in CI with crate2nix and nix
containerd - An open and reliable container runtime
nixpacks - App source + Nix packages + Docker = Image
nerdctl - contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
plane - A distributed system for running WebSocket services at scale.
docker-openwrt - OpenWrt running in Docker
cargo2nix - Granular builds of Rust projects for Nix
ofelia - A docker job scheduler (aka. crontab for docker)
buildah - A tool that facilitates building OCI images.
k3d - Little helper to run CNCF's k3s in Docker