News for hackers. Stuff that matters.
Re:Docker Is Four Things by steffres on Thursday August 31, 2023 @09:24AM (#37336795)
I'd say both.

Some is declarative, e.g. `FROM`, `ENV`, `EXPOSE`. While on the other hand `RUN`, `CMD`, etc. is fully imperative.

Re:Docker Is Four Things by tptacek on Thursday August 31, 2023 @10:42AM (#37337904)
You don't really get credit for being "both". There are maintainability and comprehensibility benefits to keeping anything imperative out of a language (you don't have to reason causally from one statement to the next), which is out the window when you introduce imperative elements. Also: in a Dockerfile, those imperative elements are the heart of the system.
Re:Docker Is Four Things by aequitas on Friday September 01, 2023 @04:47AM (#37348307)
`ENV` is a bad example because it's effect differs greatly from where it's placed in the Dockerfile. Eg: before a RUN statement consuming it's value or after.

`FROM` also has more use cases when using multi stage builds.

Re:Docker Is Four Things by steffres on Wednesday September 06, 2023 @10:58AM (#37406134)
oh, you're right. I forgot that a key characteristic of anything being "declarative" is that order of statements should not matter.

Acutally, come to think of it, since `RUN` may depend on any other Dockerfile statement (even `EXPOSE` might make a difference in code), does this mean that even a single imperative statement that is introduced in some language, makes the language imperative?