News for hackers. Stuff that matters.
Re:Alpine makes Python Docker builds slower, and images larger by cpuguy83 on Wednesday January 29, 2020 @06:13PM (#22187072)
Dependcies are also for multiple stages, e.g.:

So `COPY --from=<some stage>` and `FROM <other stage>`

Also, a Dockerfile is just a frontend for buildkit. The heart of buildkit is "LLB" (sort of like LLVM IR in usage) which is what the Dockerfile compiles into. Buildkit just executes LLB, doesn't have to be from a Dockerfile.

For that matter you can have a "Dockerfile" (in name only) that is not even really dockerfile since the format lets you specify frontend to use (which would be a container image reference) to process it.

There's even a buildkit frontend to build buildpacks: https://github.com/tonistiigi/buildkit-pack Works with any buildkit enabled builder, even `docker build`.

Re:Alpine makes Python Docker builds slower, and images larger by throwaway894345 on Wednesday January 29, 2020 @07:15PM (#22187580)
Yeah, there are a lot of workarounds when you leave the standard tooling. I like the idea of using something like Bazel to build Docker images (since modeling dependencies and caching build steps is its raison d'etre) and eschewing Dockerfiles altogether; however, I haven't tried it (and Bazel has its own costs). I'm not familiar with buildkit in particular, but it's cool that it has an internal representation. I'll have to dig around.
Re:Alpine makes Python Docker builds slower, and images larger by takeda on Thursday January 30, 2020 @12:38AM (#22189125)
Nix also can build efficient docker images and computes layers in a way to make them reusable among multiple projects.
Re:Alpine makes Python Docker builds slower, and images larger by cpuguy83 on Thursday January 30, 2020 @12:47AM (#22189153)
Yes! Check out https://nixery.dev/
Re:Alpine makes Python Docker builds slower, and images larger by takeda on Friday January 31, 2020 @12:59PM (#22203803)
Yeah, it is cool, but it feels more like a demo for nix.

If you want to create docker image of your own app, you probably would use:

https://nixos.org/nixpkgs/manual/#sec-pkgs-dockerTools

This will produce an exported docker image as tar file, which then you can import it using either docker, or tool like skopeo[1] (which is also included in nixpkgs).

The nix-shell functionality is also quite nice, because it allows you to create common development environment, with all tooling available that one might need to work.

[1] https://github.com/containers/skopeo

Re:Alpine makes Python Docker builds slower, and images larger by tazjin on Thursday February 06, 2020 @12:32PM (#22258124)
> If you want to create docker image of your own app, you probably would use [...]

Nixery can be pointed at your own package set, in fact I do this for deployments of my personal services[0].

This doesn't interfere with any of the local Nix functionality. I find it makes for a pleasing CI loop, where CI builds populate my Nix cache[1] and deployment manifests just need to be updated with the most recent git commit hash[2].

(I'm the author of Nixery)

[0]: https://git.tazj.in/tree/ops/infra/kubernetes/nixery [1]: https://git.tazj.in/tree/ops/sync-gcsr/manifest.yaml#n17 [2]: https://git.tazj.in/tree/ops/infra/kubernetes/tazblog/config...

Re:Alpine makes Python Docker builds slower, and images larger by cpuguy83 on Wednesday January 29, 2020 @08:36PM (#22188135)
I'm not sure I understand what you mean by workarounds and "leavings standard tooling"
Re:Alpine makes Python Docker builds slower, and images larger by weberc2 on Wednesday January 29, 2020 @08:45PM (#22188179)
I’m guessing he meant roughly ”docker build”