fix: do not set network flag when building dockerfile images

The network flag is unsupported by the docker image build command under buildx (which is default now).

Closes #7520
This commit is contained in:
Jose Diaz-Gonzalez
2025-03-09 06:56:56 -04:00
parent ed58641d41
commit 87cbbdbc9a
2 changed files with 12 additions and 4 deletions

View File

@@ -10,12 +10,17 @@ import (
)
// TriggerDockerArgsProcess outputs the network plugin docker options for an app
func TriggerDockerArgsProcess(appName string) error {
func TriggerDockerArgsProcess(stage string, appName string, imageSourceType string) error {
stdin, err := io.ReadAll(os.Stdin)
if err != nil {
return err
}
if stage == "build" && imageSourceType == "dockerfile" {
fmt.Print(string(stdin))
return nil
}
initialNetwork := reportComputedInitialNetwork(appName)
if initialNetwork != "" {
fmt.Printf(" --network=%s ", initialNetwork)