Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does always_pull do? #55

Closed
uduse opened this issue Jun 6, 2020 · 5 comments
Closed

What does always_pull do? #55

uduse opened this issue Jun 6, 2020 · 5 comments
Milestone

Comments

@uduse
Copy link

uduse commented Jun 6, 2020

My guess is that pulling a previously built image will facilitate layer-reusing, like using the old image as a cache. Am I right?

@missinglink
Copy link

Found my way here after reading the docs and wondering the same thing...

I read it as meaning:

Attempt to first pull the image and use the build-cache where possible to avoid building the exact same thing twice (or parts of it)

.. although if that is correct I don't see why it would be false by default 🤷‍♂️

@missinglink
Copy link

hmm unfortunately not, I enabled always_pull: true after having successfully published the same action previously and it still ran the whole build (~15mins) again.

my understanding is that the build cache is not stored in the published images anyway, so I'm not sure if that's even possible?

really not sure what the purpose of always_pull is 😕

@missinglink
Copy link

missinglink commented Aug 4, 2020

Down the rabbit hole.. the Go code appends --pull to docker build, the documentation for it also just says:

Always attempt to pull a newer version of the image

Got an answer from this Stackoverflow post

Essentially always_pull is used for the case where you have a locally built version of that specific baseimage tag (which could be old, like an old ubuntu:latest on your HDD) but you'd prefer that the build step pulled the newest one before running docker build.

So for GH actions it's not relevant, as either you've published the baseimage in a previous step (meaning it would be pulled down again) or you don't have the baseimage locally and it would be pulled as part of docker build.

IMO it could probably be removed, or at least better documented since we both assumed the wrong thing.

@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2020

@missinglink

IMO it could probably be removed, or at least better documented since we both assumed the wrong thing.

This input has been renamed pull in build-push-action v2 (#92) to be more consistent. You can already try it by combining it with:

@crazy-max crazy-max added this to the v2 milestone Sep 2, 2020
@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

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

No branches or pull requests

3 participants