feat: add ability to specify the initial container network

Closes #4477
This commit is contained in:
Jose Diaz-Gonzalez
2021-03-22 01:05:35 -04:00
parent 1bb4e4920b
commit 017037586c
5 changed files with 75 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ package network
import (
"fmt"
"io/ioutil"
"os"
"strings"
"unicode/utf8"
@@ -10,6 +11,22 @@ import (
"github.com/dokku/dokku/plugins/config"
)
// TriggerDockerArgsProcess outputs the network plugin docker options for an app
func TriggerDockerArgsProcess(appName string) error {
stdin, err := ioutil.ReadAll(os.Stdin)
if err != nil {
return err
}
initialNetwork := reportComputedInitialNetwork(appName)
if initialNetwork != "" {
fmt.Printf(" --network=%s ", initialNetwork)
}
fmt.Print(string(stdin))
return nil
}
// TriggerInstall runs the install step for the network plugin
func TriggerInstall() error {
if err := common.PropertySetup("network"); err != nil {