How is the volumes configuration of docker-compose.yml written in Dockerfile?

  docker, question

The specific configuration of docker-compose.yml is as follows:

volumes:
 - ./:/src/

If you want to write directly in the Dockerfile, what is the equivalent?

Your understanding is wrong. docker-compose is actually configured todocker runThe parameters of, andDockerfileThere is no equivalent relationship