mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
merge master
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
commit
b881a6c3c2
7 changed files with 48 additions and 41 deletions
22
commands.go
22
commands.go
|
@ -879,7 +879,7 @@ func (cli *DockerCli) CmdHistory(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, out := range outs.Data {
|
for _, out := range outs.Data {
|
||||||
outID := out.Get("ID")
|
outID := out.Get("Id")
|
||||||
if !*quiet {
|
if !*quiet {
|
||||||
if *noTrunc {
|
if *noTrunc {
|
||||||
fmt.Fprintf(w, "%s\t", outID)
|
fmt.Fprintf(w, "%s\t", outID)
|
||||||
|
@ -1171,7 +1171,7 @@ func (cli *DockerCli) CmdImages(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if filter != "" {
|
if filter != "" {
|
||||||
if filter == image.Get("ID") || filter == utils.TruncateID(image.Get("ID")) {
|
if filter == image.Get("Id") || filter == utils.TruncateID(image.Get("Id")) {
|
||||||
startImage = image
|
startImage = image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,7 +1229,7 @@ func (cli *DockerCli) CmdImages(args ...string) error {
|
||||||
for _, repotag := range out.GetList("RepoTags") {
|
for _, repotag := range out.GetList("RepoTags") {
|
||||||
|
|
||||||
repo, tag := utils.ParseRepositoryTag(repotag)
|
repo, tag := utils.ParseRepositoryTag(repotag)
|
||||||
outID := out.Get("ID")
|
outID := out.Get("Id")
|
||||||
if !*noTrunc {
|
if !*noTrunc {
|
||||||
outID = utils.TruncateID(outID)
|
outID = utils.TruncateID(outID)
|
||||||
}
|
}
|
||||||
|
@ -1255,12 +1255,12 @@ func (cli *DockerCli) WalkTree(noTrunc bool, images *engine.Table, byParent map[
|
||||||
for index, image := range images.Data {
|
for index, image := range images.Data {
|
||||||
if index+1 == length {
|
if index+1 == length {
|
||||||
printNode(cli, noTrunc, image, prefix+"└─")
|
printNode(cli, noTrunc, image, prefix+"└─")
|
||||||
if subimages, exists := byParent[image.Get("ID")]; exists {
|
if subimages, exists := byParent[image.Get("Id")]; exists {
|
||||||
cli.WalkTree(noTrunc, subimages, byParent, prefix+" ", printNode)
|
cli.WalkTree(noTrunc, subimages, byParent, prefix+" ", printNode)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printNode(cli, noTrunc, image, prefix+"\u251C─")
|
printNode(cli, noTrunc, image, prefix+"\u251C─")
|
||||||
if subimages, exists := byParent[image.Get("ID")]; exists {
|
if subimages, exists := byParent[image.Get("Id")]; exists {
|
||||||
cli.WalkTree(noTrunc, subimages, byParent, prefix+"\u2502 ", printNode)
|
cli.WalkTree(noTrunc, subimages, byParent, prefix+"\u2502 ", printNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1268,7 +1268,7 @@ func (cli *DockerCli) WalkTree(noTrunc bool, images *engine.Table, byParent map[
|
||||||
} else {
|
} else {
|
||||||
for _, image := range images.Data {
|
for _, image := range images.Data {
|
||||||
printNode(cli, noTrunc, image, prefix+"└─")
|
printNode(cli, noTrunc, image, prefix+"└─")
|
||||||
if subimages, exists := byParent[image.Get("ID")]; exists {
|
if subimages, exists := byParent[image.Get("Id")]; exists {
|
||||||
cli.WalkTree(noTrunc, subimages, byParent, prefix+" ", printNode)
|
cli.WalkTree(noTrunc, subimages, byParent, prefix+" ", printNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1281,10 +1281,10 @@ func (cli *DockerCli) printVizNode(noTrunc bool, image *engine.Env, prefix strin
|
||||||
parentID string
|
parentID string
|
||||||
)
|
)
|
||||||
if noTrunc {
|
if noTrunc {
|
||||||
imageID = image.Get("ID")
|
imageID = image.Get("Id")
|
||||||
parentID = image.Get("ParentId")
|
parentID = image.Get("ParentId")
|
||||||
} else {
|
} else {
|
||||||
imageID = utils.TruncateID(image.Get("ID"))
|
imageID = utils.TruncateID(image.Get("Id"))
|
||||||
parentID = utils.TruncateID(image.Get("ParentId"))
|
parentID = utils.TruncateID(image.Get("ParentId"))
|
||||||
}
|
}
|
||||||
if parentID == "" {
|
if parentID == "" {
|
||||||
|
@ -1301,9 +1301,9 @@ func (cli *DockerCli) printVizNode(noTrunc bool, image *engine.Env, prefix strin
|
||||||
func (cli *DockerCli) printTreeNode(noTrunc bool, image *engine.Env, prefix string) {
|
func (cli *DockerCli) printTreeNode(noTrunc bool, image *engine.Env, prefix string) {
|
||||||
var imageID string
|
var imageID string
|
||||||
if noTrunc {
|
if noTrunc {
|
||||||
imageID = image.Get("ID")
|
imageID = image.Get("Id")
|
||||||
} else {
|
} else {
|
||||||
imageID = utils.TruncateID(image.Get("ID"))
|
imageID = utils.TruncateID(image.Get("Id"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(cli.out, "%s%s Virtual Size: %s", prefix, imageID, utils.HumanSize(image.GetInt64("VirtualSize")))
|
fmt.Fprintf(cli.out, "%s%s Virtual Size: %s", prefix, imageID, utils.HumanSize(image.GetInt64("VirtualSize")))
|
||||||
|
@ -1382,7 +1382,7 @@ func (cli *DockerCli) CmdPs(args ...string) error {
|
||||||
|
|
||||||
for _, out := range outs.Data {
|
for _, out := range outs.Data {
|
||||||
var (
|
var (
|
||||||
outID = out.Get("ID")
|
outID = out.Get("Id")
|
||||||
outNames = out.GetList("Names")
|
outNames = out.GetList("Names")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -12,18 +12,22 @@ Binaries
|
||||||
**This instruction set is meant for hackers who want to try out Docker
|
**This instruction set is meant for hackers who want to try out Docker
|
||||||
on a variety of environments.**
|
on a variety of environments.**
|
||||||
|
|
||||||
Before following these directions, you should really check if a packaged version
|
Before following these directions, you should really check if a
|
||||||
of Docker is already available for your distribution. We have packages for many
|
packaged version of Docker is already available for your distribution.
|
||||||
distributions, and more keep showing up all the time!
|
We have packages for many distributions, and more keep showing up all
|
||||||
|
the time!
|
||||||
|
|
||||||
|
|
||||||
Check runtime dependencies
|
Check runtime dependencies
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
.. DOC COMMENT: this should be kept in sync with
|
||||||
|
https://github.com/dotcloud/docker/blob/master/hack/PACKAGERS.md#runtime-dependencies
|
||||||
|
|
||||||
To run properly, docker needs the following software to be installed at runtime:
|
To run properly, docker needs the following software to be installed at runtime:
|
||||||
|
|
||||||
- GNU Tar version 1.26 or later
|
- iproute2 version 3.5 or later (build after 2012-05-21), and
|
||||||
- iproute2 version 3.5 or later (build after 2012-05-21), and specifically the "ip" utility
|
specifically the "ip" utility
|
||||||
- iptables version 1.4 or later
|
- iptables version 1.4 or later
|
||||||
- The LXC utility scripts (http://lxc.sourceforge.net) version 0.8 or later
|
- The LXC utility scripts (http://lxc.sourceforge.net) version 0.8 or later
|
||||||
- Git version 1.7 or later
|
- Git version 1.7 or later
|
||||||
|
@ -33,11 +37,11 @@ To run properly, docker needs the following software to be installed at runtime:
|
||||||
Check kernel dependencies
|
Check kernel dependencies
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
Docker in daemon mode has specific kernel requirements. For details, see
|
Docker in daemon mode has specific kernel requirements. For details,
|
||||||
http://docs.docker.io/en/latest/articles/kernel/
|
check your distribution in :ref:`installation_list`.
|
||||||
|
|
||||||
Note that Docker also has a client mode, which can run on virtually any linux kernel (it even builds
|
Note that Docker also has a client mode, which can run on virtually
|
||||||
on OSX!).
|
any linux kernel (it even builds on OSX!).
|
||||||
|
|
||||||
|
|
||||||
Get the docker binary:
|
Get the docker binary:
|
||||||
|
@ -63,18 +67,18 @@ Run the docker daemon
|
||||||
Giving non-root access
|
Giving non-root access
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
The ``docker`` daemon always runs as the root user, and since Docker version
|
The ``docker`` daemon always runs as the root user, and since Docker
|
||||||
0.5.2, the ``docker`` daemon binds to a Unix socket instead of a TCP port. By
|
version 0.5.2, the ``docker`` daemon binds to a Unix socket instead of
|
||||||
default that Unix socket is owned by the user *root*, and so, by default, you
|
a TCP port. By default that Unix socket is owned by the user *root*,
|
||||||
can access it with ``sudo``.
|
and so, by default, you can access it with ``sudo``.
|
||||||
|
|
||||||
Starting in version 0.5.3, if you (or your Docker installer) create a
|
Starting in version 0.5.3, if you (or your Docker installer) create a
|
||||||
Unix group called *docker* and add users to it, then the ``docker``
|
Unix group called *docker* and add users to it, then the ``docker``
|
||||||
daemon will make the ownership of the Unix socket read/writable by the
|
daemon will make the ownership of the Unix socket read/writable by the
|
||||||
*docker* group when the daemon starts. The ``docker`` daemon must
|
*docker* group when the daemon starts. The ``docker`` daemon must
|
||||||
always run as the root user, but if you run the ``docker`` client as a user in
|
always run as the root user, but if you run the ``docker`` client as a
|
||||||
the *docker* group then you don't need to add ``sudo`` to all the
|
user in the *docker* group then you don't need to add ``sudo`` to all
|
||||||
client commands.
|
the client commands.
|
||||||
|
|
||||||
.. warning:: The *docker* group is root-equivalent.
|
.. warning:: The *docker* group is root-equivalent.
|
||||||
|
|
||||||
|
@ -82,7 +86,8 @@ client commands.
|
||||||
Upgrades
|
Upgrades
|
||||||
--------
|
--------
|
||||||
|
|
||||||
To upgrade your manual installation of Docker, first kill the docker daemon:
|
To upgrade your manual installation of Docker, first kill the docker
|
||||||
|
daemon:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
|
|
|
@ -811,6 +811,8 @@ Known Issues (kill)
|
||||||
|
|
||||||
* :issue:`197` indicates that ``docker kill`` may leave directories
|
* :issue:`197` indicates that ``docker kill`` may leave directories
|
||||||
behind and make it difficult to remove the container.
|
behind and make it difficult to remove the container.
|
||||||
|
* :issue:`3844` lxc 1.0.0 beta3 removed ``lcx-kill`` which is used by Docker versions before 0.8.0;
|
||||||
|
see the issue for a workaround.
|
||||||
|
|
||||||
.. _cli_load:
|
.. _cli_load:
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ func TestGetImagesJSON(t *testing.T) {
|
||||||
}
|
}
|
||||||
assertHttpNotError(r2, t)
|
assertHttpNotError(r2, t)
|
||||||
|
|
||||||
images2 := engine.NewTable("ID", 0)
|
images2 := engine.NewTable("Id", 0)
|
||||||
if _, err := images2.ReadListFrom(r2.Body.Bytes()); err != nil {
|
if _, err := images2.ReadListFrom(r2.Body.Bytes()); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ func TestGetImagesJSON(t *testing.T) {
|
||||||
|
|
||||||
found = false
|
found = false
|
||||||
for _, img := range images2.Data {
|
for _, img := range images2.Data {
|
||||||
if img.Get("ID") == unitTestImageID {
|
if img.Get("Id") == unitTestImageID {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ func TestGetImagesJSON(t *testing.T) {
|
||||||
}
|
}
|
||||||
assertHttpNotError(r3, t)
|
assertHttpNotError(r3, t)
|
||||||
|
|
||||||
images3 := engine.NewTable("ID", 0)
|
images3 := engine.NewTable("Id", 0)
|
||||||
if _, err := images3.ReadListFrom(r3.Body.Bytes()); err != nil {
|
if _, err := images3.ReadListFrom(r3.Body.Bytes()); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ func TestGetContainersJSON(t *testing.T) {
|
||||||
if len(containers.Data) != beginLen+1 {
|
if len(containers.Data) != beginLen+1 {
|
||||||
t.Fatalf("Expected %d container, %d found (started with: %d)", beginLen+1, len(containers.Data), beginLen)
|
t.Fatalf("Expected %d container, %d found (started with: %d)", beginLen+1, len(containers.Data), beginLen)
|
||||||
}
|
}
|
||||||
if id := containers.Data[0].Get("ID"); id != containerID {
|
if id := containers.Data[0].Get("Id"); id != containerID {
|
||||||
t.Fatalf("Container ID mismatch. Expected: %s, received: %s\n", containerID, id)
|
t.Fatalf("Container ID mismatch. Expected: %s, received: %s\n", containerID, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,8 @@ func cleanup(eng *engine.Engine, t *testing.T) error {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
for _, image := range images.Data {
|
for _, image := range images.Data {
|
||||||
if image.Get("ID") != unitTestImageID {
|
if image.Get("Id") != unitTestImageID {
|
||||||
eng.Job("image_delete", image.Get("ID")).Run()
|
eng.Job("image_delete", image.Get("Id")).Run()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -288,7 +288,7 @@ func TestRestartKillWait(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(t, "Waiting on stopped container timedout", 5*time.Second, func() {
|
setTimeout(t, "Waiting on stopped container timedout", 5*time.Second, func() {
|
||||||
job = srv.Eng.Job("wait", outs.Data[0].Get("ID"))
|
job = srv.Eng.Job("wait", outs.Data[0].Get("Id"))
|
||||||
var statusStr string
|
var statusStr string
|
||||||
job.Stdout.AddString(&statusStr)
|
job.Stdout.AddString(&statusStr)
|
||||||
if err := job.Run(); err != nil {
|
if err := job.Run(); err != nil {
|
||||||
|
@ -472,7 +472,7 @@ func TestRmi(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, image := range images.Data {
|
for _, image := range images.Data {
|
||||||
if strings.Contains(unitTestImageID, image.Get("ID")) {
|
if strings.Contains(unitTestImageID, image.Get("Id")) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if image.GetList("RepoTags")[0] == "<none>:<none>" {
|
if image.GetList("RepoTags")[0] == "<none>:<none>" {
|
||||||
|
@ -650,7 +650,7 @@ func assertContainerList(srv *docker.Server, all bool, limit int, since, before
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for i := 0; i < len(outs.Data); i++ {
|
for i := 0; i < len(outs.Data); i++ {
|
||||||
if outs.Data[i].Get("ID") != expected[i] {
|
if outs.Data[i].Get("Id") != expected[i] {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -777,7 +777,7 @@ func (srv *Server) Images(job *engine.Job) engine.Status {
|
||||||
delete(allImages, id)
|
delete(allImages, id)
|
||||||
out.Set("ParentId", image.Parent)
|
out.Set("ParentId", image.Parent)
|
||||||
out.SetList("RepoTags", []string{fmt.Sprintf("%s:%s", name, tag)})
|
out.SetList("RepoTags", []string{fmt.Sprintf("%s:%s", name, tag)})
|
||||||
out.Set("ID", image.ID)
|
out.Set("Id", image.ID)
|
||||||
out.SetInt64("Created", image.Created.Unix())
|
out.SetInt64("Created", image.Created.Unix())
|
||||||
out.SetInt64("Size", image.Size)
|
out.SetInt64("Size", image.Size)
|
||||||
out.SetInt64("VirtualSize", image.getParentsSize(0)+image.Size)
|
out.SetInt64("VirtualSize", image.getParentsSize(0)+image.Size)
|
||||||
|
@ -798,7 +798,7 @@ func (srv *Server) Images(job *engine.Job) engine.Status {
|
||||||
out := &engine.Env{}
|
out := &engine.Env{}
|
||||||
out.Set("ParentId", image.Parent)
|
out.Set("ParentId", image.Parent)
|
||||||
out.SetList("RepoTags", []string{"<none>:<none>"})
|
out.SetList("RepoTags", []string{"<none>:<none>"})
|
||||||
out.Set("ID", image.ID)
|
out.Set("Id", image.ID)
|
||||||
out.SetInt64("Created", image.Created.Unix())
|
out.SetInt64("Created", image.Created.Unix())
|
||||||
out.SetInt64("Size", image.Size)
|
out.SetInt64("Size", image.Size)
|
||||||
out.SetInt64("VirtualSize", image.getParentsSize(0)+image.Size)
|
out.SetInt64("VirtualSize", image.getParentsSize(0)+image.Size)
|
||||||
|
@ -880,7 +880,7 @@ func (srv *Server) ImageHistory(job *engine.Job) engine.Status {
|
||||||
outs := engine.NewTable("Created", 0)
|
outs := engine.NewTable("Created", 0)
|
||||||
err = image.WalkHistory(func(img *Image) error {
|
err = image.WalkHistory(func(img *Image) error {
|
||||||
out := &engine.Env{}
|
out := &engine.Env{}
|
||||||
out.Set("ID", img.ID)
|
out.Set("Id", img.ID)
|
||||||
out.SetInt64("Created", img.Created.Unix())
|
out.SetInt64("Created", img.Created.Unix())
|
||||||
out.Set("CreatedBy", strings.Join(img.ContainerConfig.Cmd, " "))
|
out.Set("CreatedBy", strings.Join(img.ContainerConfig.Cmd, " "))
|
||||||
out.SetList("Tags", lookupMap[img.ID])
|
out.SetList("Tags", lookupMap[img.ID])
|
||||||
|
@ -1028,7 +1028,7 @@ func (srv *Server) Containers(job *engine.Job) engine.Status {
|
||||||
}
|
}
|
||||||
displayed++
|
displayed++
|
||||||
out := &engine.Env{}
|
out := &engine.Env{}
|
||||||
out.Set("ID", container.ID)
|
out.Set("Id", container.ID)
|
||||||
out.SetList("Names", names[container.ID])
|
out.SetList("Names", names[container.ID])
|
||||||
out.Set("Image", srv.runtime.repositories.ImageName(container.Image))
|
out.Set("Image", srv.runtime.repositories.ImageName(container.Image))
|
||||||
out.Set("Command", fmt.Sprintf("%s %s", container.Path, strings.Join(container.Args, " ")))
|
out.Set("Command", fmt.Sprintf("%s %s", container.Path, strings.Join(container.Args, " ")))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue