// CmdNetworkCreate creates a new network with a given name
//
// Usage: docker network create [OPTIONS] <NETWORK-NAME>
CmdNetworkCreate creates a new network with a given name

docker network create [OPTIONS] 
// CmdNetworkCreate creates a new network with a given name // // Usage : docker network create [ OPTIONS ] <NETWORK - NAME >
func (cli *DockerCli) CmdNetworkCreate(args ...string) error {
	cmd := Cli.Subcmd("network create", []string{"NETWORK-NAME"}, "Creates a new network with a name specified by the user", false)
	flDriver := cmd.String([]string{"d", "-driver"}, "", "Driver to manage the Network")
	cmd.Require(flag.Exact, 1)
	err := cmd.ParseFlags(args, true)
	if err != nil {
		return err
	}
	nc := types.NetworkCreate{Name: cmd.Arg(0), Driver: *flDriver, CheckDuplicate: true}
	obj, _, err := readBody(cli.call("POST", "/networks/create", nc, nil))
	if err != nil {
		return err
	}
	var resp types.NetworkCreateResponse
	err = json.Unmarshal(obj, &resp)
	if err != nil {
		return err
	}
	fmt.Fprintf(cli.out, "%s\n", resp.ID)
	return nil
}
func ( cli * DockerCli ) CmdNetworkCreate ( args ... string ) error { cmd := Cli . Subcmd ( " " , [ ] string { " " } , " " , false ) flDriver := cmd . String ( [ ] string { " " , " " } , " " , " " ) cmd . Require ( flag . Exact , 1 ) err := cmd . ParseFlags ( args , true ) if err != nil { return err } nc := types . NetworkCreate { Name : cmd . Arg ( 0 ) , Driver : * flDriver , CheckDuplicate : true } obj , _ , err := readBody ( cli . call ( " " , " " , nc , nil ) ) if err != nil { return err } var resp types . NetworkCreateResponse err = json . Unmarshal ( obj , & resp ) if err != nil { return err } fmt . Fprintf ( cli . out , " \n " , resp . ID ) return nil }
CmdNetworkCreate creates a new network with a given name
CmdNetworkCreate creates a new network with a given name
// Construct network create request body