mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31: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 {
|
for i, image := range images {
|
||||||
// func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)
|
// func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error)
|
||||||
|
|
||||||
name := "none"
|
firstTag := ""
|
||||||
tags := image.RepoTags
|
tags := image.RepoTags
|
||||||
if len(tags) > 0 {
|
if len(tags) > 0 {
|
||||||
name = tags[0]
|
firstTag = tags[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
nameParts := strings.Split(name, ":")
|
nameParts := strings.Split(firstTag, ":")
|
||||||
tag := ""
|
tag := ""
|
||||||
|
name := "none"
|
||||||
if len(nameParts) > 1 {
|
if len(nameParts) > 1 {
|
||||||
tag = nameParts[1]
|
tag = nameParts[len(nameParts)-1]
|
||||||
|
name = strings.Join(nameParts[:len(nameParts)-1], ":")
|
||||||
}
|
}
|
||||||
|
|
||||||
ownImages[i] = &Image{
|
ownImages[i] = &Image{
|
||||||
ID: image.ID,
|
ID: image.ID,
|
||||||
Name: nameParts[0],
|
Name: name,
|
||||||
Tag: tag,
|
Tag: tag,
|
||||||
Image: image,
|
Image: image,
|
||||||
Client: c.Client,
|
Client: c.Client,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue