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

Docker: Improved Control Over Local Image Usage with FROM Command #544

Closed
jgod opened this issue Sep 12, 2023 · 1 comment
Closed

Docker: Improved Control Over Local Image Usage with FROM Command #544

jgod opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
build Improvements to developers build experience with Docker community_new New idea raised by a community contributor

Comments

@jgod
Copy link

jgod commented Sep 12, 2023

Tell us about your request
I'm requesting a new feature that allows users to have improved control over the usage of local images with the FROM command in Dockerfiles.

Dockerfile:

FROM --local-only my-local-image

In this example, Docker would exclusively use the local image named "my-local-image," and if it does not exist locally, it would raise an error instead of trying to pull it from a remote registry.

Which service(s) is this request for?
Docker.

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
Currently, Docker automatically attempts to pull images from a registry if they are not found locally.

The existing behavior today (as far as I know) with this workflow involving local images also leaves a possible attack vector open because of coincidental "namesquatting" on a/the registry; meaning, you currently have to care about the names of remote things when you know you only want to deal with local things.

Are you currently working around the issue?
Tagging local images with non-existent repository names.

@jgod jgod added the community_new New idea raised by a community contributor label Sep 12, 2023
@jgod jgod changed the title Improved Control Over Local Image Usage with FROM Command Docker: Improved Control Over Local Image Usage with FROM Command Sep 12, 2023
@thaJeztah thaJeztah added the build Improvements to developers build experience with Docker label Sep 25, 2023
@thaJeztah
Copy link
Member

Thank you for opening this ticket. This looks like something that's depending on features to be implemented in BuildKit, which is an upstream open-source project (co-maintained by Docker).

At a glance, I'm not sure if this is something that must/can be defined in the Dockerfile syntax, as a local "image-cache" is only available when used with the "docker-engine" driver, but not in other situations where BuildKit is running as a standalone builder.

That said, there is an existing proposal to implement pull-policies that can be passed as argument when performing a build, similar to pull-policies that can be specified on docker run (and docker create);

I'll close the ticket here, but welcome you to participate on that ticket to describe your use-case (which can help the maintainers to decide on the best design for such a feature). Also feel free to continue the conversation after I closed the ticket 👍

@thaJeztah thaJeztah closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Improvements to developers build experience with Docker community_new New idea raised by a community contributor
Projects
None yet
Development

No branches or pull requests

2 participants