The answer to this question seems to have changed with new versions of docker-compose.
There is a label "com.docker.compose.project.working_dir": "/var/opt/docker",
that points to the directory where I started docker-compose. I have not checked if that is pwd
or the actual location of the docker-compose.yml file.
This got me interesting information about docker-compose:
samuel@vmhost1:~$ docker inspect fc440a1afbaa | grep com.docker.compose "com.docker.compose.config-hash": "89069285a4783b79b421ea84f2b652becbdee148fbad095a6d9d85aab67ececc", "com.docker.compose.container-number": "1", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "docker", "com.docker.compose.project.config_files": "docker-compose.yml", "com.docker.compose.project.working_dir": "/var/opt/docker", "com.docker.compose.service": "jenkins", "com.docker.compose.version": "1.25.0" samuel@vmhost1:~$
I’m running docker-compose.yml configuration version 3.6