Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Nephin 4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Yuanhong Peng 600ad5c1b7 Remove links when remove container
Steps to reproduce:
```
    # docker run -tid --name aaa ubuntu
    57bfd00ac5559f72eec8c1b32a01fe38427d66687940f74611e65137414f0ada
    # docker run -tid --name bbb --link aaa ubuntu
    23ad18362950f39b638206ab4d1885fd4f50cbd1d16aac9cab8e97e0c8363471
    # docker ps --no-trunc
    CONTAINER ID                                                       IMAGE
    COMMAND             CREATED             STATUS              PORTS
    NAMES
    23ad18362950f39b638206ab4d1885fd4f50cbd1d16aac9cab8e97e0c8363471
    ubuntu              "/bin/bash"         4 seconds ago       Up 3 seconds
    bbb
    57bfd00ac5559f72eec8c1b32a01fe38427d66687940f74611e65137414f0ada
    ubuntu              "/bin/bash"         14 seconds ago      Up 14
    seconds                           aaa,bbb/aaa
    # docker rm -f bbb
    bbb
    # docker ps --no-trunc
    CONTAINER ID                                                       IMAGE
    COMMAND             CREATED             STATUS              PORTS
    NAMES
    57bfd00ac5559f72eec8c1b32a01fe38427d66687940f74611e65137414f0ada
    ubuntu              "/bin/bash"         29 seconds ago      Up 28
    seconds                           aaa,bbb/aaa
    # docker rm --link bbb/aaa
    Error response from daemon: Cannot get parent /bbb for name /bbb/aaa
```

When we rm container `bbb`, we can still see `bbb/aaa` in `docker ps
--no-trunc`. And this link cannot be deleted since container `bbb` has
already been removed.

We should remove links of a container when it is deleted.

Signed-off-by: Yuanhong Peng <pengyuanhong@huawei.com>
2017-07-18 12:09:26 +08:00
John Howard 3f6127b173 Windows: Factor out sqlite
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-12-01 09:38:08 -08:00
Brian Goff 2600777469 Add migration from sqlite links back to hostConfig
Before #16032, once links were setup
in the sqlite db, hostConfig.Links was cleared out.
This means that we need to migrate data back out of the sqlite db and
put it back into hostConfig.Links so that links specified on older
daemons can be used.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-01-11 11:31:29 -05:00
Brian Goff 0f9f99500c Build names and links at runtime
Don't rely on sqlite db for name registration and linking.
Instead register names and links when the daemon starts to an in-memory
store.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-01-07 14:10:42 -05:00