Skip to content

introduce no_cache and pull to force a full rebuild#232

Merged
ndeloof merged 5 commits intocompose-spec:masterfrom
ndeloof:no_cache
May 2, 2022
Merged

introduce no_cache and pull to force a full rebuild#232
ndeloof merged 5 commits intocompose-spec:masterfrom
ndeloof:no_cache

Conversation

@ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Mar 2, 2022

What this PR does / why we need it:

Introduce no_cache and pull attributes in the build section.
Those allow to force a full rebuild from sources + sync with registry regarding the base image being used.

I don't expect those to be directly set by end-users in their compose.yml file, but getting them part of the compose model will allow Compose Implementations to offer --no-cache and --pull to compose build (or equivalent) command.

@ndeloof ndeloof requested review from EricHripko, glours and ulyssessouza and removed request for ulyssessouza March 2, 2022 07:23
@ndeloof ndeloof force-pushed the no_cache branch 2 times, most recently from 90365d8 to 91eb78b Compare March 2, 2022 13:56
Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are introducing these primarily for CLI flags and don't expect these to be set by the user, should these be documented at all? Taking it further, should these be part of the schema at all? 🤔

@ndeloof
Copy link
Collaborator Author

ndeloof commented Mar 15, 2022

@EricHripko this is already the case for a bunch of parameter that I don't think user should hardcode in yaml, but some do, because we can't guess all usages... Having this part of the compose spec model makes it more transparent.

Typically, using variable interpolation one can declare:

services:
   foo:
     build:
        pull: ${DO_NOT_PULL:-false}

.. so that by default a fresh pull will always take place (some user/company have a base image moving fast) but still can be disabled by env variable.

@EricHripko
Copy link
Collaborator

Thank you for elaborating 👍

Copy link
Collaborator

@EricHripko EricHripko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for looking into this ✅ Left a suggestion inline, feel free to land once it's addressed.

glours and others added 2 commits May 2, 2022 10:19
Co-authored-by: Eric Hripko <eric@hripko.com>
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
@ndeloof ndeloof merged commit 6c1f542 into compose-spec:master May 2, 2022
@ndeloof ndeloof deleted the no_cache branch May 2, 2022 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants