News for hackers. Stuff that matters.
Re:What Exactly is Docker? by fnord77 on Saturday February 01, 2020 @02:31PM (#22212657)
I wish Dockerfiles allowed you to group commands so that they would end up in the same layer, so you don't have to do something ridiculous like

RUN cmd1 && cmd2 && cmd3 && cmd4

maybe with brackets:

    # 1 layer

    { 

      RUN cmd1

      COPY someshit

      RUN cmd2 -lots -of -long flags

      ...

    }
Re:What Exactly is Docker? by IanCal on Saturday February 01, 2020 @03:31PM (#22213042)
You might be interested in this: https://github.com/uber/makisu

I've not used it but it's on my list to try out, the explicit caching I think ties in with what you're after:

* Requires no elevated privileges or containerd/Docker daemon, making the build process portable.

* Uses a distributed layer cache to improve performance across a build cluster.

* Provides control over generated layers with a new optional keyword #!COMMIT, reducing the number of layers in images.

* Is Docker compatible. Note, the Dockerfile parser in Makisu is opinionated in some scenarios. More details can be found here.

Re:What Exactly is Docker? by IanCal on Sunday February 02, 2020 @09:45AM (#22217118)
I can't edit any more, but I'd really be interested in people's experiences with it.
Re:What Exactly is Docker? by silviot on Sunday February 02, 2020 @03:31PM (#22219229)
Nowadays docker server, when run with the experimental flag, allows you to build images with the `--squash` option, so your whole image will contain a single layer.

Alternatively you can use buildah [1] to build your images via a script, but you'll lose the cache docker puts in place.

[1] https://buildah.io/

Re:What Exactly is Docker? by fctorial on Saturday February 01, 2020 @03:38PM (#22213079)
Why do you want to avoid multiple layers. Performance?
Re:What Exactly is Docker? by orf on Saturday February 01, 2020 @04:56PM (#22213520)
Build performance, image size and deployment speed mostly.
Re:What Exactly is Docker? by kortex on Saturday February 01, 2020 @09:55PM (#22214851)
Each layer is a write only operation. So if you `RUN some_build.sh` and then `RUN rm junk`, you basically do nothing to reduce the final image size. So you see a lot of like `RUN some_build.sh && rm -rf junk`. There's some overhead with each layer as well.
Re:What Exactly is Docker? by lbotos on Saturday February 01, 2020 @03:56PM (#22213174)
Size of the resulting container is my understanding.