mirror of
https://github.com/docker/docs.git
synced 2026-03-31 00:08:55 +07:00
@@ -49,11 +49,15 @@ func (containers Containers) Get(IDOrName string) *Container {
|
||||
|
||||
// Match name, /name or engine/name.
|
||||
for _, container := range containers {
|
||||
found := false
|
||||
for _, name := range container.Names {
|
||||
if name == IDOrName || name == "/"+IDOrName || container.Engine.ID+name == IDOrName || container.Engine.Name+name == IDOrName {
|
||||
return container
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if found {
|
||||
candidates = append(candidates, container)
|
||||
}
|
||||
}
|
||||
|
||||
if size := len(candidates); size == 1 {
|
||||
|
||||
Reference in New Issue
Block a user