mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Merge pull request #27 from tiborvass/docker-ui
build: add more docker UI (context/dockerfile handling, iidfile, add-host, network)
This commit is contained in:
@ -24,19 +24,19 @@ type buildOptions struct {
|
||||
labels []string
|
||||
buildArgs []string
|
||||
|
||||
cacheFrom []string
|
||||
target string
|
||||
platforms []string
|
||||
secrets []string
|
||||
ssh []string
|
||||
outputs []string
|
||||
cacheFrom []string
|
||||
target string
|
||||
platforms []string
|
||||
secrets []string
|
||||
ssh []string
|
||||
outputs []string
|
||||
imageIDFile string
|
||||
extraHosts []string
|
||||
networkMode string
|
||||
|
||||
// unimplemented
|
||||
extraHosts []string
|
||||
squash bool
|
||||
quiet bool
|
||||
networkMode string
|
||||
imageIDFile string
|
||||
squash bool
|
||||
quiet bool
|
||||
|
||||
// hidden
|
||||
// untrusted bool
|
||||
@ -62,21 +62,12 @@ type commonOptions struct {
|
||||
}
|
||||
|
||||
func runBuild(dockerCli command.Cli, in buildOptions) error {
|
||||
if len(in.extraHosts) > 0 {
|
||||
return errors.Errorf("extra hosts currently not implemented")
|
||||
}
|
||||
if in.squash {
|
||||
return errors.Errorf("squash currently not implemented")
|
||||
}
|
||||
if in.quiet {
|
||||
return errors.Errorf("quiet currently not implemented")
|
||||
}
|
||||
if in.networkMode != "default" {
|
||||
return errors.Errorf("network currently not implemented")
|
||||
}
|
||||
if in.imageIDFile != "" {
|
||||
return errors.Errorf("iidfile currently not implemented")
|
||||
}
|
||||
|
||||
ctx := appcontext.Context()
|
||||
|
||||
@ -86,12 +77,15 @@ func runBuild(dockerCli command.Cli, in buildOptions) error {
|
||||
DockerfilePath: in.dockerfileName,
|
||||
InStream: os.Stdin,
|
||||
},
|
||||
Tags: in.tags,
|
||||
Labels: listToMap(in.labels),
|
||||
BuildArgs: listToMap(in.buildArgs),
|
||||
Pull: in.pull,
|
||||
NoCache: in.noCache,
|
||||
Target: in.target,
|
||||
Tags: in.tags,
|
||||
Labels: listToMap(in.labels),
|
||||
BuildArgs: listToMap(in.buildArgs),
|
||||
Pull: in.pull,
|
||||
NoCache: in.noCache,
|
||||
Target: in.target,
|
||||
ImageIDFile: in.imageIDFile,
|
||||
ExtraHosts: in.extraHosts,
|
||||
NetworkMode: in.networkMode,
|
||||
}
|
||||
|
||||
platforms, err := build.ParsePlatformSpecs(in.platforms)
|
||||
@ -170,9 +164,6 @@ func buildCmd(dockerCli command.Cli) *cobra.Command {
|
||||
flags.StringVar(&options.imageIDFile, "iidfile", "", "Write the image ID to the file")
|
||||
flags.BoolVar(&options.squash, "squash", false, "Squash newly built layers into a single new layer")
|
||||
flags.MarkHidden("quiet")
|
||||
flags.MarkHidden("network")
|
||||
flags.MarkHidden("add-host")
|
||||
flags.MarkHidden("iidfile")
|
||||
flags.MarkHidden("squash")
|
||||
|
||||
// hidden flags
|
||||
|
Reference in New Issue
Block a user