mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Repository with port does not show the correct image name
This commit is contained in:
parent
cf31c23fad
commit
a5ff4d595c
1 changed files with 7 additions and 5 deletions
|
|
@ -112,21 +112,23 @@ func (c *DockerCommand) RefreshImages() ([]*Image, error) {
|
|||
for i, image := range images {
|
||||
// func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)
|
||||
|
||||
name := "none"
|
||||
firstTag := ""
|
||||
tags := image.RepoTags
|
||||
if len(tags) > 0 {
|
||||
name = tags[0]
|
||||
firstTag = tags[0]
|
||||
}
|
||||
|
||||
nameParts := strings.Split(name, ":")
|
||||
nameParts := strings.Split(firstTag, ":")
|
||||
tag := ""
|
||||
name := "none"
|
||||
if len(nameParts) > 1 {
|
||||
tag = nameParts[1]
|
||||
tag = nameParts[len(nameParts)-1]
|
||||
name = strings.Join(nameParts[:len(nameParts)-1], ":")
|
||||
}
|
||||
|
||||
ownImages[i] = &Image{
|
||||
ID: image.ID,
|
||||
Name: nameParts[0],
|
||||
Name: name,
|
||||
Tag: tag,
|
||||
Image: image,
|
||||
Client: c.Client,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue