News for hackers. Stuff that matters.
Re:Docker Is Four Things by strogonoff on Thursday August 31, 2023 @10:44AM (#37337953)
> This blurs the meaning of "declarative" to the point of meaningless

The alternative is to draw a clear line where there is none.

> One of the things which makes Dockerfiles imperative is the sequence of Dockerfile commands is significant; if you swap the order of a COPY, RUN to a RUN, COPY, the result changes significantly.

By that logic you can call every Nix program “imperative”. They are sequences of strings, the order of which matters. The horror!

A Docker image is a stack of layers. Every layer points to a preceding layer. It’s not a huge leap from that structure to a fairly elegant sugar of a string array, where each string is a declaration that applies to preceding layer thus describing the next one. I don’t see anything fundamentally imperative about it; it can be used in imperative ways, but anything can.

Re:Docker Is Four Things by rgoulter on Thursday August 31, 2023 @11:51AM (#37339146)
> The alternative is to draw a clear line where there is none.

I'd say that more/less "imperative" refers to describing sequences of actions that take place (especially those which might modify some state), whereas "declarative" is more about a structure of what the result should be.

I can agree that a Docker image can be considered as a structure, and that it's possible to construct one declaratively. Whereas I'd say a Dockerfile is an imperative construction of that.

Re:Docker Is Four Things by strogonoff on Saturday September 02, 2023 @05:02AM (#37359720)
Dockerfile describes a set of immutable layers. Whether you model it in your head as a sequence of commands or as a description of a set of immutable layers, is up to you.