Skip to content

Commit 89c91ff

Browse files
authored
Merge pull request #32934 from sftim/20220414_fix_git_ownership_trust_concern
Work around git directory ownership change check
2 parents 13a928b + edb9f05 commit 89c91ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ RUN mkdir $HOME/src && \
2727
FROM golang:1.16-alpine
2828

2929
RUN apk add --no-cache \
30+
runuser \
3031
git \
3132
openssh-client \
3233
rsync \
3334
npm && \
3435
npm install -D autoprefixer postcss-cli
3536

36-
RUN mkdir -p /usr/local/src && \
37-
cd /usr/local/src && \
37+
RUN mkdir -p /var/hugo && \
3838
addgroup -Sg 1000 hugo && \
39-
adduser -Sg hugo -u 1000 -h /src hugo
39+
adduser -Sg hugo -u 1000 -h /var/hugo hugo && \
40+
chown -R hugo: /var/hugo && \
41+
runuser -u hugo -- git config --global --add safe.directory /src
4042

4143
COPY --from=0 /go/bin/hugo /usr/local/bin/hugo
4244

0 commit comments

Comments
 (0)