Dockers do not make up installation volumes

Just install the docker toolbar on Windows 10, and I have a little problem with my docker containers. When I create the dockers, the instance will start, but nothing will be installed in the / var / www / html directory. If I open Kitematic, I see a container, and when I click on volumes, I donโ€™t see a set of local folders. This is what my docker-compose.yml looks like.

web: build: . ports: - "80:80" volumes: - app/:/var/www/html/ 

Do I need to specify an absolute path to my local directory? The application directory is in the same folder as the docker-compose.yml file.

+5
source share
2 answers

In addition to @VonC's answer, it is different when using docker-compose , since docs mentions

You can set the relative path on the host, which will expand the relative into the directory of the used Compose configuration file. Relative paths should always begin with . or ..

+5
source

Do I need to specify an absolute path to my local directory?

Yes. The document mentions :

host-dir can be an absolute path or value of a name.

  • If you specify an absolute path for host-dir , bind the Docker bindings to the path you specify.
  • If you specify a name, Docker will create a named volume under that name.

In your case, app/ will be treated as a name, not as a host folder.

+2
source

Source: https://habr.com/ru/post/1239109/


All Articles