Docker-compose fails to execute in AKS


Help please! I can’t quite understand why docker-compose fails to execute in an AKS container :frowning: . Currently this is the output of the docker-compose command:

root@ado-agent-5dc44f99-6ppnk:/azp/agent/_work/1/s# docker-compose run --rm terraform2
Pulling terraform2 (hashicorp/terraform:light)...
light: Pulling from hashicorp/terraform
c9b1b535fdd9: Pull complete
de7e97a272b4: Pull complete
96f252e89940: Pull complete
Digest: sha256:5e19b9bab0b6d079cae8822be22cd7010f65177356600154b77fc4fc81bdde31
Status: Downloaded newer image for hashicorp/terraform:light
Traceback (most recent call last):
  File "bin/docker-compose", line 6, in <module>
  File "compose/cli/", line 72, in main
  File "compose/cli/", line 128, in perform_command
  File "compose/cli/", line 865, in run
  File "compose/cli/", line 1349, in run_one_off_container
  File "compose/cli/", line 1469, in call_docker
  File "", line 339, in call
  File "", line 800, in __init__
  File "", line 1462, in _execute_child
  File "", line 810, in fsencode
TypeError: expected str, bytes or os.PathLike object, not NoneType
[1077] Failed to execute script docker-compose

The contents of the docker-compose.yml are as follows:

version: '3.0'
    image: hashicorp/terraform:light
    user: root
    env_file: .env
    working_dir: /opt/
      - .:/opt:rw
      - ~/.azure:/root/.azure

Thanks in advance.