Skip to content

Commit

Permalink
Create files with host user ids
Browse files Browse the repository at this point in the history
When running docker with the php image, any command is run as root,
unless. It is possible to specify another user to run as with the --user
option though.
Note that creating the user and group on the docker image does not seem
to be required for this to work, so let us just not do it. This spares
us from creating a custom entrypoint file.
  • Loading branch information
greg0ire committed Jul 3, 2023
1 parent 605d8eb commit 90fb333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PHP_BIN = docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:8.2-cli php -d memory_limit=1024M
PHP_BIN = docker run -it --rm --user $$(id -u):$$(id -g) -v${PWD}:/opt/project -w /opt/project php:8.2-cli php -d memory_limit=1024M

.PHONY: help
help: ## Displays this list of targets with descriptions
Expand Down

0 comments on commit 90fb333

Please sign in to comment.