5 ms·
Building Containers Without Docker
- victor106 6y agoFor Java you can use jib from google https://github.com/GoogleContainerTools/jib https://github.com/GoogleContainerTools/jib
- donmcronald 6y agoHere's a related blog post that does a nice job of showing how dependencies and resources should be put in different layers. https://phauer.com/2019/no-fat-jar-in-docker-image/ https://phauer.com/2019/no-fat-jar-in-docker-image/
- gtirloni 6y agoThis is pretty interesting, thanks for sharing. I wonder if there's something similar in the Node.js ecosystem EDIT: I guess the same happens if the package.json/lock file doesn't change.
- deleted 6y ago[deleted]
- donmcronald 6y agoI don't know of anything that does it automatically. I think there's a lot of room for improvement in image building. No one seems to care about how bad it is currently though.
- pjmlp 6y agoAnd for .NET, tye. https://github.com/dotnet/tye https://github.com/dotnet/tye
- ImJasonH 6y agoShameless plug: if you just need to build a container that runs a Go program, you can't do it much simpler than with https://github.com/google/ko https://github.com/google/ko `ko publish` does a `go build` and stuffs it in a base image, it even supports multi-arch images with `--platform=all`.
- darksaints 6y agoYou've got a statically compiled, fully contained executable. Why would you need to wrap that in the overhead of a container?
- anaganisk 6y agoBecause thats how people use go applications in docker swarm, K8s etc??
- judge2020 6y agoYou can say "I want to run image us-docker.pkg.dev/something:v1 in my cluster with these ports exposed" instead of having to spin up VMs, place the exe there (or attach a volume with it pre-placed), then configure the firewalls for those VMs.
- jjtheblunt 6y agobecause you might want to deliver it in its "nest", i.e., a filesystem with resources the go binary wants to access at runtime
- pjmlp 6y agoOn proper desktop OS those resources are embedded in the binary.
- jjtheblunt 6y agoagreeing with your comment, and a coffee epiphany resulted: it also made me realize that the container IS such a beast, as it's a binary file format that is handled by a different linker-loader, that which takes such a binary file, extracts the runnable content and runs it in a mounted bundled filesystem.
- CameronNemo 6y agoI like umoci for image manipulation. https://github.com/opencontainers/umoci https://github.com/opencontainers/umoci
- larschdk 6y agosystemd also has container support baked it. It's actually as simple as 'pacstrap/debootstrap' followed by 'machinectl start'.
- CameronNemo 6y agosystemd is literally a container runtime with a dependency system baked in. Anything you can do with nspawn you can do with normal service units from what I can tell.
- steeve 6y agoIt is also possible to build docker images with Bazel and rules_docker [1], which doesn't require docker itself, and can run unprivileged. That said, it is not compatible with Dockerfile (obviously) but you can do some cool things such as compose layers individually into a final image. 1. https://github.com/bazelbuild/rules_docker https://github.com/bazelbuild/rules_docker