mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add dynamic os/arch detection to Images
This commit is contained in:
parent
e4561438f1
commit
f9359f59a8
2 changed files with 4 additions and 1 deletions
4
graph.go
4
graph.go
|
@ -10,6 +10,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
@ -131,7 +132,8 @@ func (graph *Graph) Create(layerData archive.Archive, container *Container, comm
|
||||||
DockerVersion: VERSION,
|
DockerVersion: VERSION,
|
||||||
Author: author,
|
Author: author,
|
||||||
Config: config,
|
Config: config,
|
||||||
Architecture: "x86_64",
|
Architecture: runtime.GOARCH,
|
||||||
|
OS: runtime.GOOS,
|
||||||
}
|
}
|
||||||
if container != nil {
|
if container != nil {
|
||||||
img.Parent = container.Image
|
img.Parent = container.Image
|
||||||
|
|
1
image.go
1
image.go
|
@ -28,6 +28,7 @@ type Image struct {
|
||||||
Author string `json:"author,omitempty"`
|
Author string `json:"author,omitempty"`
|
||||||
Config *Config `json:"config,omitempty"`
|
Config *Config `json:"config,omitempty"`
|
||||||
Architecture string `json:"architecture,omitempty"`
|
Architecture string `json:"architecture,omitempty"`
|
||||||
|
OS string `json:"os,omitempty"`
|
||||||
graph *Graph
|
graph *Graph
|
||||||
Size int64
|
Size int64
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue