🏡 index : ~doyle/rgit.git

author Geert Stappers <stappers@stappers.it> 2023-08-30 11:08:06.0 +02:00:00
committer Geert Stappers <stappers@stappers.it> 2023-08-30 11:08:06.0 +02:00:00
commit
8c46d65fc5eed8683b27c4656707966f8fdeeabe [patch]
tree
516ce8074c877289885cdd8fcc5b8d6baa3e0425
parent
509a6bd91392a60df67fa16b5441ec9253c45e2f
download
8c46d65fc5eed8683b27c4656707966f8fdeeabe.tar.gz

Dockerfile: Drop user nobody

Docker user has to be set with --user UID:GID
to match UID and GID of the git repositoris on the filesystem
to avoid 'repository path '/git/foo/' is not owned by current user'
errors.

Ownership of the executable doesn't matter.

Diff

 Dockerfile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index d68762c..b1801aa 100644
--- a/Dockerfile
+++ a/Dockerfile
@@ -5,11 +5,9 @@
COPY . /sources
WORKDIR /sources
RUN cargo build --release
RUN chown nobody:nogroup /sources/target/release/rgit

FROM debian:bullseye-slim
COPY --from=builder /sources/target/release/rgit /rgit

USER nobody
EXPOSE 8000
ENTRYPOINT ["/rgit", "[::]:8000", "/git", "-d", "/tmp/rgit-cache.db"]