diff --git a/cli/cmd/compose/build.go b/cli/cmd/compose/build.go index 0948db1ee..2c6817a17 100644 --- a/cli/cmd/compose/build.go +++ b/cli/cmd/compose/build.go @@ -38,6 +38,9 @@ func buildCommand() *cobra.Command { return runBuild(cmd.Context(), opts, args) }, } + buildCmd.Flags().StringVar(&opts.WorkingDir, "workdir", "", "Work dir") + buildCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files") + return buildCmd } diff --git a/local/e2e/compose_test.go b/local/e2e/compose_test.go index 5507c29fa..0f38067b2 100644 --- a/local/e2e/compose_test.go +++ b/local/e2e/compose_test.go @@ -37,6 +37,13 @@ func TestLocalBackendComposeUp(t *testing.T) { networkList := c.RunDockerCmd("--context", "default", "network", "ls") + t.Run("build", func(t *testing.T) { + res := c.RunDockerCmd("compose", "build", "-f", "../../tests/composefiles/demo_multi_port.yaml") + res.Assert(t, icmd.Expected{Out: "COPY words.sql /docker-entrypoint-initdb.d/"}) + res.Assert(t, icmd.Expected{Out: "COPY pom.xml ."}) + res.Assert(t, icmd.Expected{Out: "COPY static /static/"}) + }) + t.Run("up", func(t *testing.T) { c.RunDockerCmd("compose", "up", "-f", "../../tests/composefiles/demo_multi_port.yaml", "--project-name", projectName) })