mirror of https://github.com/docker/compose.git
Merge pull request #999 from gtardif/compose_build_flags
Add compose build flags for file and working dir
This commit is contained in:
commit
1d71be31b6
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue