Conversation
cli/cmd/compose/up.go
Outdated
| } | ||
|
|
||
| if contextType == store.LocalContextType { | ||
| flags.StringVar(&opts.PullPolicy, "pull", "", "Define pull policy for service images (always|never|if_not_present|build).") |
There was a problem hiding this comment.
docker run uses "missing" for the if_not_present case (which is the default);
--pull string Pull image before running ("always"|"missing"|"never") (default "missing")
For backward-compatibility (--pull used to be a "boolean" on docker run), specifying --pull without a value is equivalent to --pull=always. Not sure if we need to add that logic here (because this is a new flag).
What's the build option? It's a bit unclear to me what it's intended for; if that's meant for "only do a pull if we also have to do a build", should we keep it simple, and keep that for docker compose build [--pull=<policy>] ?
There was a problem hiding this comment.
this is just plain https://github.com/compose-spec/compose-spec/blob/master/spec.md#pull_policy
There was a problem hiding this comment.
that's a bit unfortunate defining this pull_policy as part of the compose-spec was not coordinated with introducion of the docker run pull flag for consistency :'(
There was a problem hiding this comment.
With the compose-spec not having a release yet, could we still change? I see I left a comment at the time in compose-spec/compose-spec#78 (comment) as well
TBH; Overall a bit on the fence of having it as an option in the compose-file itself, as it feels more of an option that should be set by the person doing the deploy, not a "declarative" option that specifies/defines the stack
gtardif
left a comment
There was a problem hiding this comment.
LGTM after updating with compose-spec/compose-go#99
|
Thx @thaJeztah ! |
|
I'm still confused by the
Note that the combination of
So I'm still quite uncomfortable with the pull policy being in the compose-file itself; this really feels like an option that should generally be passed on the commandline, as it's not declarative. |
The compose spec actually defines an model, and attributes can be set by yaml or command line flags, depending the implementation. This is up to users to decide if they want to hard code some behaviour in the yaml file or repeat
this is what pull_policy has been designed for. |
I understand how it's used, but still think there's a separation between describing/declaring a "stack", and runtime options / options for a specific deploy (I recall some discussion on that in docker/compose#846) |
|
Most of the |
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
|
closing this, will see later if we want to introduce this flag to compose command |

What I did
Allow user to pass
--pull=neveror--pull=alwaysto force some image lifecycleRelated issue
see docker/compose#6464 and related debates on pull vs build vs never pull vs pull before build etc
(not mandatory) A picture of a cute animal, if possible in relation with what you did