0

i have build a docker image that contains multiple configuration files inside the docker container. Now i want to write a docker compose file that uses this docker image and maps the configuration file into the host system. The reason: I want to be able to configure the configuration files with the host system without accessing the container.

How can i do that? I tried to define a volume inside the compose file. But if i start the container, it creates the directory on the host system. But the directory is empty. The mapped volume insider the container is not empty.

Best regards

  • 2
    Can you share your `Dockerfile` for creating the image and the `docker-compose.yml` file? – Matteo Zanoni Mar 03 '22 at 13:16
  • The linked question describes a workaround to use Docker's "initialize a volume on first use" feature with a named volume that's actually a Linux bind mount. You also might try distributing the user-editable configuration files outside the container, the same way you're distributing the `docker-compose.yml` file. – David Maze Mar 03 '22 at 14:09

0 Answers0