Cannot mount single file to container using docker-compose

Expected behavior

Using the following configuration in docker-compose.yaml will make textfile.txt on host machine show up in the container at /tmp/textfile.txt
volumes:
- ./src/textfile.txt:/tmp/textfile.txt

Actual behavior

Container has an empty directory at /tmp/textfile.txt

Are you get solution? recently related posts any solution of that problem.

Made an issue of this https://github.com/docker/machine/issues/3540