wodby / php

Generic PHP docker container images
MIT License
152 stars 103 forks source link

Unable to start php container when using Git worktree #100

Closed zviryatko closed 4 years ago

zviryatko commented 4 years ago

When using git worktree php containers can't be started because it runs git command in entrypoint script. Since git worktree instead of storing everything in .git dir it provides .git file with the next content:

gitdir: /home/user/project/.git/worktrees/branch-name

so until this directory isn't accessible any git command inside the container will not work. To solve this issue needs to share this path inside the container:

php:
    volumes:
      - /home/user/project/.git:/home/user/project/.git

I think it's better to add to documentation FAQ

csandanov commented 4 years ago

I haven't worked with git worktree, so git config --global doesn't work? is it because there's no .git/config?

zviryatko commented 4 years ago

Yes, exactly, any git command in project directory.

csandanov commented 4 years ago

Fixed