pass in UID and GID so hounted volumes have correct owner (todo: make it dynameic)

This commit is contained in:
Gitea
2020-12-11 11:14:32 +00:00
parent e95651837f
commit fcc6b97d58
3 changed files with 15 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
FROM golang:1.15-alpine3.12
ARG GOPROXY
ARG UID
ARG GID
ENV GOPROXY ${GOPROXY:-direct}
ARG GITEA_VERSION
@@ -15,6 +18,8 @@ WORKDIR /src
EXPOSE 22 3000
RUN echo DEBUG: "gg ${GID} uu ${UID}"
RUN apk --no-cache add \
bash \
ca-certificates \
@@ -29,13 +34,13 @@ RUN apk --no-cache add \
gnupg
RUN addgroup \
-S -g 1000 \
-S -g ${GID} \
git && \
adduser \
-S -H -D \
-h /home/git \
-s /bin/bash \
-u 1000 \
-u ${UID} \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd