Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
Move multiple user-docker images to rancher/os-dind
Browse files Browse the repository at this point in the history
  • Loading branch information
niusmallnan committed Dec 13, 2018
1 parent 846bb25 commit 1b15e7a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
26 changes: 11 additions & 15 deletions cmd/control/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ import (
"golang.org/x/net/context"
)

var (
SupportedDindVersions = []string{"cnrancher/docker:17.12.1-dind", "cnrancher/docker:18.03.1-dind"}
)

func engineSubcommands() []cli.Command {
return []cli.Command{
{
Expand All @@ -53,16 +49,17 @@ func engineSubcommands() []cli.Command {
},
},
{
Name: "create",
Usage: "create user Docker engine without a reboot",
ArgsUsage: "<name>",
Before: preFlightValidate,
Action: engineCreate,
Name: "create",
Usage: "create Dind engine without a reboot",
Description: "must switch user docker to 17.12.1 or earlier if using Dind",
ArgsUsage: "<name>",
Before: preFlightValidate,
Action: engineCreate,
Flags: []cli.Flag{
cli.StringFlag{
Name: "version, v",
Value: SupportedDindVersions[0],
Usage: "set the version for the engine",
Value: config.DefaultDind,
Usage: fmt.Sprintf("set the version for the engine, %s are available", config.SupportedDinds),
},
cli.StringFlag{
Name: "network",
Expand All @@ -79,7 +76,7 @@ func engineSubcommands() []cli.Command {
},
cli.StringFlag{
Name: "authorized-keys",
Usage: "set the ssh authorized_keys path for the engine",
Usage: "set the ssh authorized_keys absolute path for the engine",
},
},
},
Expand Down Expand Up @@ -414,15 +411,15 @@ func preFlightValidate(c *cli.Context) error {
}

isVersionMatch := false
for _, v := range SupportedDindVersions {
for _, v := range config.SupportedDinds {
if v == version {
isVersionMatch = true
break
}
}

if !isVersionMatch {
return errors.Errorf("Engine version not supported only %v are supported", SupportedDindVersions)
return errors.Errorf("Engine version not supported only %v are supported", config.SupportedDinds)
}

addr, err := net.ResolveTCPAddr("tcp", "localhost:"+strconv.Itoa(port))
Expand Down Expand Up @@ -495,7 +492,6 @@ func generateEngineCompose(name, version string, sshPort int, authorizedKeys, ne
Volumes: volumes,
VolumesFrom: []string{},
Command: composeYaml.Command{
"dockerd-entrypoint.sh",
"--storage-driver=overlay2",
"--data-root=" + config.MultiDockerDataDir + "/" + name,
"--host=unix://" + config.MultiDockerDataDir + "/" + name + "/docker-" + name + ".sock",
Expand Down
5 changes: 5 additions & 0 deletions config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
SystemImages = "images-system.tar"
Debug = false
SystemDockerBin = "/usr/bin/system-dockerd"
DefaultDind = "rancher/os-dind:17.12.1"

DetachLabel = "io.rancher.os.detach"
CreateOnlyLabel = "io.rancher.os.createonly"
Expand Down Expand Up @@ -77,6 +78,10 @@ var (
"rancher.autologin",
"EXTRA_CMDLINE",
}
SupportedDinds = []string{
"rancher/os-dind:17.12.1",
"rancher/os-dind:18.03.1",
}
)

func init() {
Expand Down

0 comments on commit 1b15e7a

Please sign in to comment.