From 5b0bbe7633691368b6d2ce5e29101f85851f2b0a Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 18 Oct 2013 16:02:08 -0700 Subject: [PATCH] remove docker ls and add docker link in usage and switch to go1.2rc2 Upstream-commit: 6c863b49ef9de8f203c84f7e2e55f33deeb10bdb Component: engine --- components/engine/Dockerfile | 2 +- components/engine/commands.go | 38 +------------------------------ components/engine/runtime_test.go | 2 +- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/components/engine/Dockerfile b/components/engine/Dockerfile index 3c858c8989..ff80e4ad9c 100644 --- a/components/engine/Dockerfile +++ b/components/engine/Dockerfile @@ -36,7 +36,7 @@ run apt-get install -y -q mercurial run apt-get install -y -q build-essential libsqlite3-dev # Install Go -run curl -s https://go.googlecode.com/files/go1.2rc1.src.tar.gz | tar -v -C /usr/local -xz +run curl -s https://go.googlecode.com/files/go1.2rc2.src.tar.gz | tar -v -C /usr/local -xz env PATH /usr/local/go/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin env GOPATH /go:/go/src/github.com/dotcloud/docker/vendor run cd /usr/local/go/src && ./make.bash && go install -ldflags '-w -linkmode external -extldflags "-static -Wl,--unresolved-symbols=ignore-in-shared-libs"' -tags netgo -a std diff --git a/components/engine/commands.go b/components/engine/commands.go index 55469bcbb0..6251feb34b 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -91,6 +91,7 @@ func (cli *DockerCli) CmdHelp(args ...string) error { {"insert", "Insert a file in an image"}, {"inspect", "Return low-level information on a container"}, {"kill", "Kill a running container"}, + {"link", "Link the container with a new name"}, {"login", "Register or Login to the docker registry server"}, {"logs", "Fetch the logs of a container"}, {"port", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"}, @@ -1184,43 +1185,6 @@ func (cli *DockerCli) CmdPs(args ...string) error { return nil } -func (cli *DockerCli) CmdLs(args ...string) error { - cmd := Subcmd("ls", "", "List links for containers") - flAll := cmd.Bool("a", false, "Show all links") - - if err := cmd.Parse(args); err != nil { - return nil - } - v := url.Values{} - if *flAll { - v.Set("all", "1") - } - - body, _, err := cli.call("GET", "/containers/links?"+v.Encode(), nil) - if err != nil { - return err - } - var links []APILink - if err := json.Unmarshal(body, &links); err != nil { - return err - } - - w := tabwriter.NewWriter(cli.out, 20, 1, 3, ' ', 0) - fmt.Fprintf(w, "NAME\tID\tIMAGE") - fmt.Fprintf(w, "\n") - - sortLinks(links, func(i, j APILink) bool { - return len(i.Path) < len(j.Path) - }) - for _, link := range links { - fmt.Fprintf(w, "%s\t%s\t%s", link.Path, utils.TruncateID(link.ContainerID), link.Image) - fmt.Fprintf(w, "\n") - } - w.Flush() - - return nil -} - func (cli *DockerCli) CmdLink(args ...string) error { cmd := Subcmd("link", "CURRENT_NAME NEW_NAME", "Link the container with a new name") if err := cmd.Parse(args); err != nil { diff --git a/components/engine/runtime_test.go b/components/engine/runtime_test.go index a32f5c2679..40da41801e 100644 --- a/components/engine/runtime_test.go +++ b/components/engine/runtime_test.go @@ -316,7 +316,7 @@ func startEchoServerContainer(t *testing.T, proto string) (*Runtime, *Container, strPort string runtime = mkRuntime(t) port = 5554 - p Port + p Port ) for {