Skip to content

Comments

Fix 2 docker build problems: volume name too short, dubious ownership#5009

Open
cweiske wants to merge 2 commits intophp:masterfrom
mogic-le:fix-build
Open

Fix 2 docker build problems: volume name too short, dubious ownership#5009
cweiske wants to merge 2 commits intophp:masterfrom
mogic-le:fix-build

Conversation

@cweiske
Copy link
Contributor

@cweiske cweiske commented Nov 21, 2025

When trying to build on a Debian 12 installation with docker 20.10.24 I get multiple errors:

$ make
docker run --rm -v .:/var/www/en -w /var/www -u 1000:1000 php/doc-en
docker: Error response from daemon: create .: volume name is too short, names should be at least two alphanumeric characters.
See 'docker run --help'.
make: *** [Makefile:22: xhtml] Fehler 125

and

$ make
docker run --rm -v :/var/www/en -w /var/www -u 1000:1000 php/doc-en
configure.php on PHP 8.2.29, libxml 2.9.14

fatal: detected dubious ownership in repository at '/var/www/doc-base'
To add an exception for this directory, call:

       git config --global --add safe.directory /var/www/doc-base
doc-base/temp clean up FAILED.
make: *** [Makefile:22: xhtml] Fehler 1

The two commits in this PR fix both errors.

Related: #4645

@cweiske cweiske changed the title Fix 2 docker build problems Fix 2 docker build problems: volume name too short, dubious ownership Nov 21, 2025
Passing "." as path does not work with docker 20.10.24:
> $ make
> docker run --rm -v .:/var/www/en -w /var/www -u 1000:1000 php/doc-en
> docker: Error response from daemon: create .: volume name is too short, names should be at least two alphanumeric characters.
> See 'docker run --help'.
> make: *** [Makefile:22: xhtml] Fehler 125
The current user and group ID are passed passed to the docker build command
and the ownership of the cloned directories are changed to them.
This gets rid of git's "dubious ownership" error.

Without this changes I got an error:
> $ make
> docker run --rm -v :/var/www/en -w /var/www -u 1000:1000 php/doc-en
> configure.php on PHP 8.2.29, libxml 2.9.14
>
> fatal: detected dubious ownership in repository at '/var/www/doc-base'
> To add an exception for this directory, call:
>
> 	git config --global --add safe.directory /var/www/doc-base
> doc-base/temp clean up FAILED.
> make: *** [Makefile:22: xhtml] Fehler 1

Resolves: php#4645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant