Trying to run docker-compose up to spin up this docker image: hashicorp/terraform:0.11.13 (need that specific).
I expect: a terraform container to run both terraform init and terraform apply commands but I'm unable to do so.
This is how my yaml looks like:
version: "2" services: terraform: #env_file: # - .env image: hashicorp/terraform:0.11.13 volumes: - "//c//Users/user1/development/terraform/:/tmp/test" working_dir: /tmp/test environment: AWS_ACCESS_KEY_ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AWS_SECRET_ACCESS_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx command: init /tmp/test/ && apply /tmp/test
Terraform does understand it as a bad structured syntax since it troughs me the help:
"The init command expects at most one argument"
Then tried using:
command: init /tmp/test/ command: apply /tmp/test
Error: No configuration files found!
Finally this way:
- /bin/sh - -c - | terraform init /tmp/test/ terraform apply /tmp/test
ERROR: yaml.scanner.ScannerError: while scanning a simple key in ".\docker-compose.yml", line 17, column 9 could not find expected ':' in ".\docker-compose.yml", line 18, column 9
Would you please shed some light into this?