add latest tag to every latest image dokku push
This commit is contained in:
1 parent
d12eff3fe4
commit
b6cf0ac410
1 file changed
+12
-3
@@ -88,6 +88,7 @@ func pushToRegistry(appName string, tag int, imageID string, imageRepo string) e
|
|||||||
imageTag, _ := common.GetRunningImageTag(appName, "")
|
imageTag, _ := common.GetRunningImageTag(appName, "")
|
||||||
|
|
||||||
fullImage := fmt.Sprintf("%s%s:%d", registryServer, imageRepo, tag)
|
fullImage := fmt.Sprintf("%s%s:%d", registryServer, imageRepo, tag)
|
||||||
|
latestImage := fmt.Sprintf("%s%s:latest", registryServer, imageRepo)
|
||||||
|
|
||||||
common.LogVerboseQuiet(fmt.Sprintf("Tagging %s:%d in registry format", imageRepo, tag))
|
common.LogVerboseQuiet(fmt.Sprintf("Tagging %s:%d in registry format", imageRepo, tag))
|
||||||
if !dockerTag(imageID, fullImage) {
|
if !dockerTag(imageID, fullImage) {
|
||||||
@@ -100,9 +101,11 @@ func pushToRegistry(appName string, tag int, imageID string, imageRepo string) e
|
|||||||
return errors.New("Unable to tag image")
|
return errors.New("Unable to tag image")
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the future, we should also add the ability to create the remote repository
|
// Tagging the image as latest
|
||||||
// This is only really important for registries that do not support creation on push
|
common.LogVerboseQuiet(fmt.Sprintf("Tagging %s as latest in registry format", imageRepo))
|
||||||
// Examples include AWS and Quay.io
|
if !dockerTag(imageID, latestImage) {
|
||||||
|
return errors.New("Unable to tag image as latest")
|
||||||
|
}
|
||||||
|
|
||||||
common.LogVerboseQuiet(fmt.Sprintf("Pushing %s", fullImage))
|
common.LogVerboseQuiet(fmt.Sprintf("Pushing %s", fullImage))
|
||||||
if !dockerPush(fullImage) {
|
if !dockerPush(fullImage) {
|
||||||
@@ -110,6 +113,12 @@ func pushToRegistry(appName string, tag int, imageID string, imageRepo string) e
|
|||||||
return errors.New("Unable to push image")
|
return errors.New("Unable to push image")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pushing the latest tag
|
||||||
|
common.LogVerboseQuiet(fmt.Sprintf("Pushing %s", latestImage))
|
||||||
|
if !dockerPush(latestImage) {
|
||||||
|
return errors.New("Unable to push image with latest tag")
|
||||||
|
}
|
||||||
|
|
||||||
// Only clean up when the scheduler is not docker-local
|
// Only clean up when the scheduler is not docker-local
|
||||||
// other schedulers do not retire local images
|
// other schedulers do not retire local images
|
||||||
if common.GetAppScheduler(appName) != "docker-local" {
|
if common.GetAppScheduler(appName) != "docker-local" {
|
||||||
|
|||||||
Reference in new issue
Block a user