Problem
When running a script that used docker-compose exec -w /var/www/html/... wordpress composer, I got:
ERROR: Setting workdir for exec is not supported in API < 1.35 (1.30)
The error was coming from the -w flag in the docker-compose exec command.
Solution
The fix was to update the version in docker-compose.yml from 3.5 to 3.6. The version number in the file doesn't map directly to the API version in the error message, but upgrading resolved it.
version: '3.6'
services:
wordpress:
build: ...