具有find-exec选项的docker exec(find:缺少“-exec';”的参数)

具有find-exec选项的docker exec(find:缺少“-exec';”的参数),docker,docker-compose,Docker,Docker Compose,我正在尝试以管理员身份在Windows 10 Enterprise上运行docker命令: docker-compose exec --user magento2 web find /var/www/sample-data -type d -exec chmod g+ws {} \; 但我得到了一个错误: find: missing argument to `-exec' 我试图用“”或“”逃跑: docker compose exec--user magento2 web“find/var

我正在尝试以管理员身份在Windows 10 Enterprise上运行docker命令:

docker-compose exec --user magento2 web find /var/www/sample-data -type d -exec chmod g+ws {} \;
但我得到了一个错误:

find: missing argument to `-exec'
我试图用“”或“”逃跑:

docker compose exec--user magento2 web“find/var/www/sample data-type d-exec chmod g+ws{}\”

但它又抛出了另一个错误

rpc错误:code=2 desc=oci运行时错误:exec失败:container\u linux.go:262:启动容器进程导致“exec:\”查找/var/www/sample data-type d-exec chmod g+ws{}\\\“:sta
t find/var/www/sample data-type d-exec chmod g+ws{}\\;:没有这样的文件或目录“

我如何解决这个问题?正常情况下,当我在容器中插入此命令时,一切正常。

使用sh:

docker-compose exec --user magento2 web sh -c 'find /var/www/sample-data -type d -exec chmod g+ws {} \;'