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

Image: can we add --pull and --no-cache options? #666

Closed
Tracked by #963
jdahlq opened this issue Jun 21, 2023 · 4 comments
Closed
Tracked by #963

Image: can we add --pull and --no-cache options? #666

jdahlq opened this issue Jun 21, 2023 · 4 comments
Assignees
Labels
kind/enhancement Improvements or new features resolution/wont-fix This issue won't be fixed

Comments

@jdahlq
Copy link

jdahlq commented Jun 21, 2023

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

docker.Image doesn't have the ability to force a re-pull of the base image. For example, if I have a Dockerfile like this...

FROM cloudflare/cloudflared:latest
CMD ["version]

... then Docker won't pull the newest version of the cloudflare/cloudflared base image if there is one cached locally.

Could we expose the --pull and --no-cache flags as Image arguments? Looks fairly straightforward to plumb them through to the underlying Docker Client: PullParent and NoCache.

I realize that I could (should?) explicitly version the base image in the Dockerfile. But for some things, I just want to deploy the latest stable version once a week, for example.

Affected area/feature

Pulumi Docker Provider

@jdahlq jdahlq added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jun 21, 2023
@t0yv0 t0yv0 added kind/enhancement Improvements or new features and removed needs-triage Needs attention from the triage team kind/enhancement Improvements or new features labels Jun 22, 2023
@t0yv0
Copy link
Member

t0yv0 commented Jun 22, 2023

Thanks for filing this @jdahlq ! This indeed sounds like a great improvement.

Anyone interested in this issue: upvoting helps my team prioritize; we're also open for contributions and can help shepherd a PR if anyone is interested.

Docker.Image is currently hand-crafted and not mapped to the upstream provider but it is possible to enhance its functionality.

CC @guineveresaenger in case you are aware of any duplicate requests for this.

@jdahlq
Copy link
Author

jdahlq commented Jun 22, 2023

I can take a crack at it if you'd like. Since it is hand-crafted, I assume I'd need to manually plumb it through to all the SDKs? Looking through the recent commits, this one that adds platform support looks like a good example for me to use?

@t0yv0
Copy link
Member

t0yv0 commented Jun 22, 2023

Yes that looks like a good example, thank you! You don't need to do anything special for SDKs as they will be re-generated from the schema. Much appreciated!

@blampe blampe added the resolution/wont-fix This issue won't be fixed label Apr 25, 2024
@blampe
Copy link
Contributor

blampe commented Apr 25, 2024

Hi @jdahlq, we just released a new Docker Build provider focused exclusively on building images with buildx/BuildKit. It provides --pull and --no-cache functionality out of the box, and we recommend you use it for building images going forward. Please take a look and give us feedback!

The repository is here; our blog announcement is here; and finally API docs are here along with examples of how to migrate your existing Image resources to dockerbuild.Image.

We won't be able to add this functionality in this provider for a number of reasons, so I'm closing this as wont-fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/wont-fix This issue won't be fixed
Projects
None yet
Development

No branches or pull requests

3 participants