-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Suggestion: Add source image option to docker push #38880
Copy link
Copy link
Open
Labels
area/builderBuildBuildarea/distributionImage DistributionImage Distributioncontainerd-integrationIssues and PRs related to containerd integrationIssues and PRs related to containerd integrationkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.kind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shinyFunctionality or other elements that the project doesn't currently have. Features are new and shinystatus/accepted
Metadata
Metadata
Assignees
Labels
area/builderBuildBuildarea/distributionImage DistributionImage Distributioncontainerd-integrationIssues and PRs related to containerd integrationIssues and PRs related to containerd integrationkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.Enhancements are not bugs or new features but can improve usability or performance.kind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shinyFunctionality or other elements that the project doesn't currently have. Features are new and shinystatus/accepted
Type
Projects
Status
To do
Status
Optional
Description
When building and pushing docker images in a shared environment (e.g. on a jenkins worker) there is always a possibility that between a build command and the following push command that someone else pulls the same tag as the one that is to be pushed.
This can result in a push of the other image instead of the one intended. The reason for this issue is that we can't set a source image when pushing, we have to use the same name on the local docker host as the name in the registry.
Steps to reproduce the issue:
docker build -t myregistry/an-image:stable .docker pull myregistry/an-image:stabledocker push myregistry/an-image:stable<- this will push the old image and not the one User 1 just built.Suggestion
Add an option to
docker pushthat allows users to specify which source image they want to push.Example:
docker push --source <image-id-or-name> NAME[:TAG]This addition would allow users to minimize the risk of pushing the wrong image to the registry.
Adding an option ensures backward compatibility of the command.