Be careful using $PWD variable in docker-compose.yml

Original link: https://blog.xiaoz.org/archives/18657

When deploying a service with Docker Compose recently, I used the $PWD variable in the docker-compose.yml file to specify the HOST path. However, I found that the path specified was not working as expected. To reproduce the problem, first look at a configuration file of docker-compose.yml: version: “3.9”
service

This article is transferred from: https://blog.xiaoz.org/archives/18657
This site is only for collection, and the copyright belongs to the original author.