Skip to content

Commit

Permalink
make /usr/src/myapp/ a safe dir for git
Browse files Browse the repository at this point in the history
Avoid "fatal: detected dubious ownership in repository at '/usr/src/myapp/'"
error when running git commands inside container with host volume mounted.
  • Loading branch information
lavarou committed Dec 19, 2024
1 parent 7183989 commit ba7419b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,7 @@ USER ${USER}
RUN echo 'alias integ="/usr/src/myapp/bin/integration_runner -agent /usr/src/myapp/agent/.libs/newrelic.so"' >> ~/.bashrc \
&& echo 'alias rebuild="make -C agent clean && rm agent/Makefile && make && make tests"' >> ~/.bashrc
WORKDIR /usr/src/myapp
# Avoid "fatal: detected dubious ownership in repository at '/usr/src/myapp/'" error
# when running git commands inside container with host volume mounted:
RUN git config --global --add safe.directory /usr/src/myapp/
CMD ["bash"]

0 comments on commit ba7419b

Please sign in to comment.