-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
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:
- User 1:
docker build -t myregistry/an-image:stable . - User 2:
docker pull myregistry/an-image:stable - User 1:
docker 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 push that 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status