alpine-docker / git

A useful simple git container running in alpine linux, especially for tiny linux distro, such as RancherOS, which don't have package manager.
Apache License 2.0
155 stars 86 forks source link

can i use -u start container without root #7

Closed jhsea3do closed 6 years ago

jhsea3do commented 6 years ago

I try to use "-u 1000" clone project files. cause i want create all files with lower privileges, not ROOT privileges.


docker run -u 1000 -i --rm --name git-jobs \
-v /tmp/xxx:/git \
alpine/git:latest clone git@xxx/xxx.git
Cloning into 'xxx'...
No user exists for uid 1000
fatal: Could not read from remote repository.
ozbillwang commented 6 years ago

you can build a new image and run your command with it.

$ cat Dockerfile

FROM alpine/git:latest

RUN addgroup -g 1000 gituser && \
    adduser -D -u 1000 -G gituser gituser

USER gituser
jhsea3do commented 6 years ago

thank you