Skip to content

Commit

Permalink
Merge pull request #34 from scraperwiki/implement-tags
Browse files Browse the repository at this point in the history
Implement tags for docker push
  • Loading branch information
drj11 committed Jan 21, 2015
2 parents 147874f + 35d6055 commit b5923ad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"net/http"
"os"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -177,13 +178,20 @@ func (c *Container) Pull(config UpdateEvent) error {
defer close(config.BuildComplete)
}

parts := strings.SplitN(config.Source.dockerImageName, ":", 2)

pio := docker.PullImageOptions{}
pio.Repository = config.Source.dockerImageName
log.Println("Pulling", pio.Repository)
pio.Registry = ""

pio.Repository = parts[0]
pio.Tag = "latest"
if len(parts) == 2 {
pio.Tag = parts[1]
}
pio.Registry = ""
pio.RawJSONStream = true

log.Println("Pulling", pio.Repository)

target := config.OutputStream
if target == nil {
target = os.Stderr
Expand Down

0 comments on commit b5923ad

Please sign in to comment.