| 1981 | } |
| 1982 | |
| 1983 | func loadVolumeBinds(binds []container.MountPoint) []dto.VolumeHelper { |
| 1984 | var datas []dto.VolumeHelper |
| 1985 | for _, bind := range binds { |
| 1986 | var volumeItem dto.VolumeHelper |
| 1987 | volumeItem.Type = string(bind.Type) |
| 1988 | if bind.Type == "volume" { |
| 1989 | volumeItem.SourceDir = bind.Name |
| 1990 | } else { |
| 1991 | volumeItem.SourceDir = bind.Source |
| 1992 | } |
| 1993 | volumeItem.ContainerDir = bind.Destination |
| 1994 | volumeItem.Mode = "ro" |
| 1995 | if bind.RW { |
| 1996 | volumeItem.Mode = "rw" |
| 1997 | } |
| 1998 | volumeItem.Shared = string(bind.Propagation) |
| 1999 | datas = append(datas, volumeItem) |
| 2000 | } |
| 2001 | return datas |
| 2002 | } |
| 2003 | |
| 2004 | func loadPortByInspect(id string, client *client.Client) ([]container.Port, error) { |
| 2005 | containerItem, err := client.ContainerInspect(context.Background(), id) |