mirror of
https://github.com/containers/podman.git
synced 2025-06-03 12:17:13 +08:00
Merge pull request #5508 from baude/buildaddarchos
add os|arch attributes when building
This commit is contained in:
@ -342,6 +342,7 @@ func buildCmd(c *cliconfig.BuildValues) error {
|
||||
}
|
||||
|
||||
options := imagebuildah.BuildOptions{
|
||||
Architecture: c.Arch,
|
||||
CommonBuildOpts: &buildOpts,
|
||||
AdditionalTags: tags,
|
||||
Annotations: c.Annotation,
|
||||
@ -359,6 +360,7 @@ func buildCmd(c *cliconfig.BuildValues) error {
|
||||
Layers: layers,
|
||||
NamespaceOptions: nsValues,
|
||||
NoCache: c.NoCache,
|
||||
OS: c.OS,
|
||||
Out: stdout,
|
||||
Output: output,
|
||||
OutputFormat: format,
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
. "github.com/containers/libpod/test/utils"
|
||||
@ -43,6 +44,15 @@ var _ = Describe("Podman build", func() {
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
||||
iid := session.OutputToStringArray()[len(session.OutputToStringArray())-1]
|
||||
|
||||
// Verify that OS and Arch are being set
|
||||
inspect := podmanTest.PodmanNoCache([]string{"inspect", iid})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
data := inspect.InspectImageJSON()
|
||||
Expect(data[0].Os).To(Equal(runtime.GOOS))
|
||||
Expect(data[0].Architecture).To(Equal(runtime.GOARCH))
|
||||
|
||||
session = podmanTest.PodmanNoCache([]string{"rmi", "alpine"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
|
Reference in New Issue
Block a user