pass in UID and GID so hounted volumes have correct owner (todo: make it dynameic)
This commit is contained in:
parent
e95651837f
commit
fcc6b97d58
@ -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
|
||||
|
@ -1,10 +1,14 @@
|
||||
version: '3.1'
|
||||
services:
|
||||
gitea-dev:
|
||||
build: dev
|
||||
build:
|
||||
context: dev
|
||||
args:
|
||||
UID: "${UID}"
|
||||
GID: "${GID}"
|
||||
ports:
|
||||
- 3000:3000
|
||||
user: 1000:1000
|
||||
user: "${UID}:${GID}"
|
||||
volumes:
|
||||
- ./home:/home
|
||||
- ./src:/src
|
||||
|
Loading…
Reference in New Issue
Block a user