feat(docker): add safe.directory git config for git-enabled containers
Prevents "dubious ownership" errors when running git commands in containers with mounted repositories (root user + external volume).
This commit is contained in:
parent
1c55cb8559
commit
96ce6fde1c
@ -2,6 +2,7 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates libssl3 openssh-client procps git \
|
ca-certificates libssl3 openssh-client procps git \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN git config --system --add safe.directory '*'
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./target/release/app /bin
|
COPY ./target/release/app /bin
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
@ -2,6 +2,7 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates libssl3 git \
|
ca-certificates libssl3 git \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN git config --system --add safe.directory '*'
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./target/release/git-hook /bin
|
COPY ./target/release/git-hook /bin
|
||||||
EXPOSE 8083
|
EXPOSE 8083
|
||||||
|
|||||||
@ -2,6 +2,7 @@ FROM ubuntu:24.04
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ca-certificates libssl3 git openssh-client \
|
ca-certificates libssl3 git openssh-client \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN git config --system --add safe.directory '*'
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./target/release/gitserver /bin
|
COPY ./target/release/gitserver /bin
|
||||||
EXPOSE 8021 2222
|
EXPOSE 8021 2222
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user