News for hackers. Stuff that matters.
Re:Docker Is Four Things by gitgud on Thursday August 31, 2023 @09:22AM (#37336756)
> Declarative means you define the state you want

“FROM ubuntu:latest” is pretty declarative then…

Re:Docker Is Four Things by makeva on Thursday August 31, 2023 @10:21AM (#37337576)
It an imperative command telling to copy/import another image, not different from importing a library in any other imperative language
Re:Docker Is Four Things by digitalsushi on Thursday August 31, 2023 @11:13AM (#37338447)
It is the most declarative thing in a Dockerfile. It becomes an imperative solution very quickly.

Here's an example Dockerfile:

FROM McDonalds Cheeseburger HappyMeal

RUN Get ketchup packets

RUN Squirt ketchup on fries

RUN Dump happymeal on plate

The first is declarative, a menu, you point at what you want and software makes it so.

The rest is a recipe, an imperative, a command, you tell software to perform, and software makes it so.