0

I am working on a Drupal 8 theme where there are some color preview features where my logo should appear. This is done via my preview.html file where the following is inserted:

<div class="color-preview-logo"><img src="./../logo.svg" alt="Site Logo" />
</div>

Everything works fine on my Ubuntu servers, but how do I make it work via DDEV? I have the feeling that I must have made some kind of mount, but I have no idea how to do it.

Edit: I have now tried the following docker mount command:

docker run --name logo -it --rm -v /Users/soren/Sites/drupal/unitynet.dk/web/themes/custom/jazzy_theme/logo.svg:/

But I can not really make it work. The command gives the following message: "docker run" requires at least 1 argument. I think I followed the example from this: https://docs.docker.com/storage/bind-mounts/

What am I missing?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
  • It's possible that your logo.svg is outside the project? For it to be mounted inside the container it needs to be part of the project. What is the directory of the project on the host? What is the full path to logo.svg on the host? `../logo.svg` or `./../logo.svg` are the same thing. It means "logo.svg in the directory above the docroot" in your case. But I think maybe you have the project set up as the docroot and logo.svg is above it. – rfay Sep 04 '21 at 16:53
  • My main project folder is called ~./Sites/mysitename.dk. It is in this folder my logo.svg file is located. The path to my is ~./Sites/mysitename.dk/web. – Søren Sjøstrøm Sep 05 '21 at 14:07
  • The real question is what is your *project* root. What is the full path to your .ddev directory? That's the path where you did `ddev config`. That's the project root. That's what gets mounted into the container. If logo.svg is in the directory above that... you won't find it in the container. You can just move it. Or copy it. – rfay Sep 05 '21 at 23:28

0 Answers0