Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Cleaner Cuberite integration and world customizations #74

Merged
merged 7 commits into from
Mar 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for Docker RC's
Signed-off-by: Dave Tucker <dt@docker.com>
  • Loading branch information
Dave Tucker committed Dec 8, 2016
commit cfdc9d1ad15431791fa0820189f7579edb7b6e93
15 changes: 13 additions & 2 deletions setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
log "github.com/Sirupsen/logrus"
)

const (
downloadURL = "https://get.docker.com/builds/Linux/x86_64/docker-"
rcDownloadURL = "https://test.docker.com/builds/Linux/x86_64/docker-"
)

// GetDockerBinary ensures that we have the right version docker client
// for communicating with the Docker Daemon
func (d *Daemon) GetDockerBinary() error {
Expand All @@ -33,19 +38,25 @@ func (d *Daemon) GetDockerBinary() error {
}
defer out.Close()

// determine if we're using an RC build of docker
url := downloadURL
if strings.Contains(d.Version, "rc") {
url = rcDownloadURL
}

// the method of downloading it is different for version >= 1.11.0
// (in which case it is an archive containing multiple binaries)
versionComp, err := compareVersions(d.Version, "1.11.0")
if err != nil {
return err
}
if versionComp >= 0 {
err = getClient(out, "https://get.docker.com/builds/Linux/x86_64/docker-"+d.Version+".tgz", extractClient)
err = getClient(out, url+d.Version+".tgz", extractClient)
if err != nil {
return err
}
} else {
err = getClient(out, "https://get.docker.com/builds/Linux/x86_64/docker-"+d.Version, copyClient)
err = getClient(out, url+d.Version, copyClient)
if err != nil {
return err
}
Expand Down