implement "down" with (yet another) docker-compose hack

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-09-01 15:35:31 +02:00
parent 4d11594df0
commit 4bd8a8860f
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 9 additions and 1 deletions

View File

@ -133,7 +133,15 @@ func (e ecsLocalSimulation) Convert(ctx context.Context, project *types.Project)
}
func (e ecsLocalSimulation) Down(ctx context.Context, projectName string) error {
return errors.Wrap(errdefs.ErrNotImplemented, "use docker-compose down")
cmd := exec.Command("docker-compose", "--context", "default", "--project-name", projectName, "-f", "-", "down", "--remove-orphans")
cmd.Stdin = strings.NewReader(string(`
services:
ecs-local-endpoints:
image: "amazon/amazon-ecs-local-container-endpoints"
`))
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}
func (e ecsLocalSimulation) Logs(ctx context.Context, projectName string, w io.Writer) error {