mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
feat(docker): configure static git identity
This commit is contained in:
@@ -25,6 +25,8 @@ RUN npm ci \
|
||||
FROM node:22-bookworm-slim
|
||||
|
||||
ARG CODEMAN_RUNTIME_USER=codeman
|
||||
ARG GIT_USER_EMAIL=
|
||||
ARG GIT_USER_NAME=
|
||||
ARG PUID=1000
|
||||
ARG PGID=1000
|
||||
|
||||
@@ -48,6 +50,18 @@ RUN apt-get update \
|
||||
tmux \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# A runtime home is normally a bind mount, so user-level Git configuration is
|
||||
# not durable across a fresh deployment. Keep the operator-supplied identity in
|
||||
# the image's system config instead. Both values are required together to avoid
|
||||
# producing commits with a misleading partial identity.
|
||||
RUN set -eux; \
|
||||
if [ -n "${GIT_USER_NAME}" ] || [ -n "${GIT_USER_EMAIL}" ]; then \
|
||||
test -n "${GIT_USER_NAME}"; \
|
||||
test -n "${GIT_USER_EMAIL}"; \
|
||||
git config --system user.name "${GIT_USER_NAME}"; \
|
||||
git config --system user.email "${GIT_USER_EMAIL}"; \
|
||||
fi
|
||||
|
||||
# The Docker CLI, taken from the official image rather than Debian's `docker.io`.
|
||||
# That package is the full ENGINE: with --no-install-recommends it still pulls 15
|
||||
# packages including containerd, runc, dmsetup and iptables, none of which a
|
||||
|
||||
Reference in New Issue
Block a user